DEVELOPER TOOLKIT

Brigs for Developers

CLI, REST API, and local analysis tools for AI agent governance.

CLIREST APILocal Analysis (no auth)

Quickstart

Three paths depending on your environment. Pick one and go.

Interactive (Human)
npm install -g brigs
brigs auth login          # opens browser
brigs scan run            # auto-detects local repo
brigs finding list        # view results
CI / Agent (No Browser)
npm install -g brigs
export BRIGS_API_KEY=brigs_sk_...
brigs scan run --json

Or without installing: curl -s -H "Authorization: Bearer $BRIGS_API_KEY" https://api.brigs.ai/scans -X POST | jq .

Local Only — No API key. No network.
npm install -g brigs
brigs agent-scan .        # offline governance scan
brigs ai-inventory .      # discover AI assets

Runs entirely offline. Outputs JSON with --json or SARIF with --sarif for GitHub Code Scanning.

Authentication

The CLI and REST API both support API key authentication. The CLI also supports browser-based OAuth for interactive use.

Browser Login

The fastest path for humans. Opens your default browser, signs you in, and stores the session locally.

brigs auth login

Paste Token

For headless environments where you have an API key. The key is stored in your local config.

brigs auth login --api-key brigs_sk_your_key_here

Environment Variable

Set BRIGS_API_KEY and skip login entirely. Recommended for CI/CD and agent workflows.

export BRIGS_API_KEY=brigs_sk_your_key_here
brigs scan run --json

Precedence

When multiple credentials exist, the CLI uses this order:

  1. --api-key flag (highest)
  2. BRIGS_API_KEY environment variable
  3. Stored session from brigs auth login

REST API Bearer Token

All API requests require a Bearer token. API keys use the brigs_sk_ prefix for easy identification in secret scanners.

curl https://api.brigs.ai/repos \
  -H "Authorization: Bearer brigs_sk_your_key_here"

Security: Only the SHA-256 hash of your key is stored. The plaintext is shown once at creation. Treat it like a password.

CLI Reference

The CLI reference has moved to its own page.

See full CLI reference

Code Examples

Brigs CLI

# Authenticate (pick one)
brigs auth login                        # browser OAuth
brigs auth login --api-key brigs_sk_... # paste key

# Scan and review
brigs scan run
brigs finding list --severity CRITICAL

# Posture score (machine-readable)
brigs posture --json | jq '.score'

# Local analysis (no auth needed)
brigs agent-scan . --sarif > results.sarif
brigs ai-inventory . --json

curl

# List findings
curl https://api.brigs.ai/findings \
  -H "Authorization: Bearer $BRIGS_API_KEY"

# Response: { "findings": [...], "total": 42 }

# Trigger a scan
curl -X POST https://api.brigs.ai/scans \
  -H "Authorization: Bearer $BRIGS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"repoId": "repo_123"}'

# Response: { "scan": { "id": "scn_...", "status": "QUEUED" } }

Python

import requests

API_KEY = "brigs_sk_..."
BASE = "https://api.brigs.ai"
headers = {"Authorization": f"Bearer {API_KEY}"}

# Get posture score
r = requests.get(f"{BASE}/posture/summary", headers=headers)
data = r.json()
print(f"Score: {data['score']}, Coverage: {data['coverage']}")

# List open findings
r = requests.get(f"{BASE}/findings?status=OPEN", headers=headers)
for f in r.json()["findings"]:
    print(f"{f['severity']} {f['controlKey']}: {f['summary']}")

TypeScript / Node.js

const API_KEY = process.env.BRIGS_API_KEY;
const BASE = "https://api.brigs.ai";

const headers = {
  Authorization: `Bearer ${API_KEY}`,
  "Content-Type": "application/json",
};

// Trigger a scan and poll until complete
const { scan } = await fetch(`${BASE}/scans`, {
  method: "POST", headers, body: JSON.stringify({})
}).then(r => r.json());

console.log("Scan started:", scan.id, scan.status);

Environment Variables

All environment variables recognized by the CLI and REST API.

VariableDescription
BRIGS_API_KEYAPI key — skips interactive login
BRIGS_API_URLAPI endpoint URL
BRIGS_WEB_URLWeb app URL (for browser login)
ANTHROPIC_API_KEYAnthropic key for AI remediation (brigs remediate)

API Endpoints

The API reference has moved to its own page.

See full API reference

Ready to get started?

Start with brigs auth login or set BRIGS_API_KEY for headless use.