get started

Quickstart

Add brin to your coding agent or your own agent stack in under 5 minutes. Hooks for Cursor, Claude Code, Codex, Gemini CLI. Wrappers for AI SDK, Mastra, LangChain. Free API and CLI.

agents trust external context by default — packages, web pages, MCP servers, repositories. brin scores that context before the agent acts on it. pick your setup below.

##add brin to your coding agent

your coding agent installs packages and browses the web without checking anything. add a hook and brin blocks bad packages before they install. each integration takes under 5 minutes.

AgentHow it works
CursorbeforeShellExecution hook intercepts install commands
Claude CodePreToolUse hook blocks installs before they run
Codex CLIRules block direct installs, wrapper checks brin first
Gemini CLIBeforeTool hook checks brin before shell commands
OpenCodePreToolUse hook gates shell tools

##add brin to your own agents

if you're building agents with a framework or your own stack, put brin in the tool path. check every artifact before your agent acts on it — packages, web pages, repos, MCP servers, skills.

###frameworks

wrap your tools so brin runs before any external action executes. one shared helper, every tool inherits the same policy.

FrameworkWhat it does
AI SDKwrap execute functions with a brin check
Mastracheck artifacts inside createTool()
LangChainguard DynamicStructuredTool callbacks

###email pipelines

IntegrationWhat it does
AgentMailscan incoming agent emails for phishing
Resendscan inbound emails before your app processes them

###API

under the hood, every integration does the same thing — a single header check against the brin API. no auth, no signup.

Bash
verdict=$(curl -sf -o /dev/null -w "%header{x-brin-verdict}" "https://api.brin.sh/npm/express")

if the verdict is suspicious or dangerous, block the action. if brin is unreachable, your agent keeps working as normal. the full response returns a score, verdict, and threats:

Bash
curl https://api.brin.sh/npm/express
JSON
{
  "score": 85,
  "verdict": "safe",
  "confidence": "high"
}

works for any context type:

Bash
curl https://api.brin.sh/pypi/requests
curl https://api.brin.sh/domain/example.com
curl https://api.brin.sh/repo/expressjs/express
curl https://api.brin.sh/mcp/owner/repo

see the API reference for all endpoints, parameters, and response shapes.

###CLI

Bash
npm install -g brin
Bash
brin check npm/express
JSON
{
  "score": 85,
  "verdict": "safe",
  "confidence": "high"
}

see the CLI reference for all flags and options.