CLI
The brin CLI checks packages, repos, MCP servers, domains, and PRs from your terminal. One command returns a score, verdict, and threats. No auth.
a thin Rust client over the brin API. one command returns a score, verdict, and threat data. no SDK, no auth, no signup.
##install
###via npm
###via shell
##usage
before your agent acts on any external context, one call. score, verdict, 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 |
--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 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 pipeline.
| 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. cached results come back in under 50ms — fast enough to sit in the critical path of every agent action. no queues, no cold starts.
if brin is unreachable, your agent keeps working as normal — zero downtime risk.
##environment variables
| Variable | Default | Description |
|---|---|---|
BRIN_API_URL | https://api.brin.sh | Override the API endpoint |
##local development
On this page