CLI
The brin CLI — a thin Rust client over the brin API. No SDK, no auth, no signup.
A thin Rust client over the brin API. No SDK, no auth, no signup. A single command returns a score, verdict, and threat data.
##Install
###via npm
###via shell script
##Usage
Before your agent acts on any external context, make a single call. brin returns a score, verdict, and any detected threats.
###Packages
###Repositories
###Pull requests
###MCP servers
###Agent skills
###Domains and pages
###Commits
##Flags
| Flag | Description |
|---|---|
--details | Include sub-scores (identity, behavior, content, graph) |
--webhook <url> | Receive tier-completion events as the deep scan progresses |
--headers | Print only the X-Brin-* response headers instead of the JSON body |
--tolerance <level> | conservative (default), lenient, or yolo — controls how the score maps to a verdict |
--refresh | Force a fresh scan, ignoring any cached result |
--mode <mode> | full to run the complete scan pipeline synchronously and return the final result in a single request |
--format <format> | json (default), simple, or badge |
###--details
###--webhook
brin runs a 3-tier analysis — the LLM tier takes 20–30s. Pass a webhook URL to receive results as each tier completes rather than waiting:
Events posted to your endpoint:
| Event | Description |
|---|---|
tier1_complete | Identity + registry metadata done |
tier2_complete | Static analysis done |
tier3_complete | LLM threat analysis done |
scan_complete | Final score with graph analysis |
###--headers
For fast, scriptable checks without JSON parsing:
###--tolerance
Override the default verdict mapping. See Safety tolerance for the full score-to-verdict table.
###--refresh
Force a fresh scan, bypassing any cached result. Useful when a package has just published a new version:
###--mode
Run the complete scan pipeline synchronously. Without this flag, brin returns a preliminary score immediately and runs the full scan in the background. With --mode full, the request blocks until every tier finishes:
###--format
Control the output format. Defaults to json.
Flags can be combined:
##What we score
Seven types of external context that agents consume autonomously — each with a distinct threat model and scoring methodology.
| Origin | Example | Threats detected |
|---|---|---|
npm / pypi / crate | npm/express | Install-time attacks, credential harvesting, typosquatting |
domain / page | domain/example.com | Prompt injection, phishing, cloaking, exfiltration via hidden content |
repo | repo/owner/repo | Agent config injection, malicious commits, compromised dependencies |
pr | pr/owner/repo/123 | Author risk, prompt injection, secret exposure, CI sabotage, suspicious diff behavior |
skill | skill/owner/repo | Description injection, output poisoning, instruction override |
mcp | mcp/owner/server | Tool shadowing, schema abuse, silent capability escalation |
commit | commit/owner/repo@sha | PR injection, security sabotage, backdoor introduction |
##How it works
Before your agent acts on any external context, brin returns a score, verdict, and any detected threats. Pre-scanned results return in under 10ms — fast enough to sit in the critical path of every agent action, no queues, no cold starts.
If brin is unreachable, the agent continues as normal — zero risk to your existing workflow.
##Environment variables
| Variable | Default | Description |
|---|---|---|
BRIN_API_URL | https://api.brin.sh | Override the API endpoint |
##Local development
On this page