api

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

Bash
npm install -g brin

###via shell script

Bash
curl -fsSL https://brin.sh/install.sh | sh

##Usage

Bash
brin check <origin>/<identifier>

Before your agent acts on any external context, make a single call. brin returns a score, verdict, and any detected threats.

###Packages

Bash
brin check npm/express
brin check npm/lodash@4.17.21
brin check pypi/requests
brin check crate/serde
JSON
{
  "origin": "npm",
  "name": "express",
  "score": 81,
  "confidence": "medium",
  "verdict": "safe",
  "tolerance": "conservative",
  "scanned_at": "2026-02-25T09:00:00Z",
  "url": "https://api.brin.sh/npm/express"
}

###Repositories

Bash
brin check repo/expressjs/express

###MCP servers

Bash
brin check mcp/modelcontextprotocol/servers

###Agent skills

Bash
brin check skill/owner/repo

###Domains and pages

Bash
brin check domain/example.com
brin check page/example.com/login

###Commits

Bash
brin check commit/owner/repo@abc123def

##Flags

FlagDescription
--detailsInclude sub-scores (identity, behavior, content, graph)
--webhook <url>Receive tier-completion events as the deep scan progresses
--headersPrint only the X-Brin-* response headers instead of the JSON body

###--details

Bash
brin check npm/express --details
JSON
{
  "origin": "npm",
  "name": "express",
  "score": 81,
  "verdict": "safe",
  "sub_scores": {
    "identity": 95.0,
    "behavior": 40.0,
    "content": 100.0,
    "graph": 30.0
  }
}

###--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:

Bash
brin check npm/express --webhook https://your-server.com/brin-callback

Events posted to your endpoint:

EventDescription
tier1_completeIdentity + registry metadata done
tier2_completeStatic analysis done
tier3_completeLLM threat analysis done
scan_completeFinal score with graph analysis

###--headers

For fast, scriptable checks without JSON parsing:

Bash
brin check npm/express --headers
Text
X-Brin-Score: 81
X-Brin-Verdict: safe
X-Brin-Confidence: medium
X-Brin-Tolerance: conservative

Flags can be combined:

Bash
brin check npm/express --details --webhook https://your-server.com/cb

##What we score

Six types of external context that agents consume autonomously — each with a distinct threat model and scoring methodology.

OriginExampleThreats detected
npm / pypi / cratenpm/expressInstall-time attacks, credential harvesting, typosquatting
domain / pagedomain/example.comPrompt injection, phishing, cloaking, exfiltration via hidden content
reporepo/owner/repoAgent config injection, malicious commits, compromised dependencies
skillskill/owner/repoDescription injection, output poisoning, instruction override
mcpmcp/owner/serverTool shadowing, schema abuse, silent capability escalation
commitcommit/owner/repo@shaPR 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.

Text
brin check npm/express
      |
      v
GET https://api.brin.sh/npm/express
      |
      v
  score · verdict · threats

If brin is unreachable, the agent continues as normal — zero risk to your existing workflow.

##Environment variables

VariableDefaultDescription
BRIN_API_URLhttps://api.brin.shOverride the API endpoint

##Local development

Bash
git clone https://github.com/superagent-ai/brin
cd brin
cargo build
cargo test