
Sanction
io.github.ericlovold由 GitHub 账号 ericlovold 发布v0.10.0更新于 Oct 27, 2026
Approval and budget checks before agent spending or tool use. Cooperative MCP; host must ask.
概览
Sanction 是一个授权服务,让助手在花钱、调用工具或使用凭据前先申请审批、预算与策略检查。
- 可以做什么
- 为消费、工具调用、资源开通和能力获取申请授权,返回批准、升级人工或拒绝
- 升级给人工审批,并在重试时兑换一次性、有时效的授权凭证
- 签发与验证限定范围的凭据授权令,并注入保险库中的凭据
- 读取审计事件、决策证据与报表摘要,并校验签名导出
- 用历史决策模拟候选策略,并预览策略包
- 适用场景
- 当智能体涉及资金、工具或凭据操作,且希望由策略引擎逐项批准、升级或拒绝并留下审计记录时使用。个人可免费使用,组织可用它跨智能体群执行预算与审批区间。
- 运行要求
- 需要 Sanction 账户和智能体 API 密钥(pxy_...),通过 SANCTION_API_KEY 或 x-api-key 请求头提供;可用 SANCTION_API_URL 设置 API 地址。可作为远程端点使用,也可通过 npx sanction-mcp 本地运行。远程传输声明需要 OAuth。
安装
在 SourceWeft 中
- 打开 控制台中的 Sanction,将其添加到工作区。
- 连接 所需的 凭据。它们会被私密存储,绝不会在公开页面上展示。
- 为需要使用其工具的对话启用该服务。
Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。
交给智能体安装
把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。
阅读 https://sourceweft.com/mcp/io.github.ericlovold%2Fsanction/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。其他 MCP 客户端
把它添加到你客户端的 mcpServers 配置中。 客户端会在首次连接时完成 OAuth 登录。
{
"mcpServers": {
"sanction": {
"type": "http",
"url": "https://getsanction.com/mcp"
}
}
}README
Sanction
The independent authorization plane for AI agents.
Before an agent spends money, invokes a tool, touches a credential, or provisions a resource, it asks Sanction. Sanction approves, escalates to a human, or denies. Every decision is logged and auditable. Sanction belongs to no platform: one policy engine answers across model providers, payment rails, identities, and agent ecosystems.
Need one human approval?
Connect Sanction to your agent, then ask it to call sanction_authorize_tool
with require_approval: true and the exact proposed action. Approve or deny
through the existing approval link or configured Slack channel. Approval gives
that request an expiring, single-use grant; the agent must redeem it before acting.
No policy edit is required, and blocked actions stay blocked.
Individuals can use Sanction free, without a card. The host must ask and honor the decision; connection alone does not enforce its other tools. Install on your host · Choose your host and try one approval.
Who runs Sanction
- Organizations governing their own AI — the primary case. Teams and departments become wallets in a tree; budgets, tool rules, and approval bands are enforced — not dashboarded — with chargeback-ready reporting underneath. Alerts tell you what happened; a decision happens first.
- Platforms and agencies embedding governance — agents you ship or run for clients carry a wallet wherever they execute: MCP hosts, Bedrock, your own stack via SDK or REST.
- Individuals — free, no card, personal and production use.
What it does
One policy decision engine governs every kind of agent action:
What a decision looks like in practice — one POST /authorize with an
amount, three possible outcomes, all of them terminal or resumable:
- Approved →
{ "status": "approved" }; budget counters debit in the same transaction the decision persists (an advisory lock makes sibling agents queue, not race). - Escalated →
{ "status": "escalated", "request_id": "…" }; a human sees it in the approval inbox, and approving mints a one-use grant the agent redeems by retrying withgrant_id. Policy decides what a timeout means (approve or deny) — nothing hangs forever. - Denied →
{ "status": "denied", "decision_code": "PER_TXN_LIMIT", "remediation": "Amount exceeds the per-transaction limit. Split into smaller charges or ask the owner to raise the limit." }. Codes are stable machine strings (DAILY_BUDGET_EXCEEDED,CATEGORY_BLOCKED,WALLET_FROZEN, …) so agents branch and replan instead of parsing prose. Replays of the same request return the same code.
Around the engine:
- Human approvals → one-use grants. Escalations land in an approval inbox (dashboard PWA, email, Slack). Approving mints a single-use, expiring grant the agent redeems on retry. Policy timeouts guarantee a terminal outcome.
- Seats. An agent is a seat you can hand to whoever holds it: named holders, contractor auto-expiry (the key fails closed past the date), key rotation that keeps history, and batch creation from one template.
- Budgets that cascade. Wallets nest into trees; subtree caps are enforced atomically so sibling agents can't race past a parent's limit. The console's spend view draws the month's runway — cumulative burn against the cap, pace, and the projected exhaust date — from wallet down to seat.
- Notifications that find you. Email by default; signed JSON webhooks for
machines; and Slack two ways — a pasted incoming-webhook URL that deep-links
to the decision, or Add to Slack, which installs per workspace over OAuth
and posts interactive Approve / Deny buttons that run the same
resolveApprovalpath as the dashboard, actor recorded. Each route subscribes to its own events. Guide - Evidence you can replay. Every policy edit becomes an immutable
revision; every decision stores the revision in force and the exact context
the engine evaluated.
GET /authorize/{id}/evidencere-runs the pure rules over the stored context and proves the outcome reproduces. - What-if over real history.
POST /policy/simulatereplays stored decisions under a candidate policy — which calls flip, what spend wouldn't clear — before you change anything. - The audit plane.
GET /audit-eventsmerges every decision, token log, and secret access into one feed (CSV export included);GET /reporting/summaryspans any period with day buckets and per-seat rollups; wallet stats project burn pace and exhaustion ETAs; a weekly digest lands in Slack every Monday. - Tamper-evident exports.
GET /audit/exporthands you a signed, hash-chained snapshot of your governed decisions: altering, dropping, or reordering any row breaks the chain, and the head is HMAC-signed by Sanction. A regulator or the governed customer runsPOST /audit/verify— self-contained, no database — to prove nothing changed after signing, down to the first broken link. - A console that opens on the roster. The dashboard home is the wallet tree
as groups with agents as cards, each carrying a mandate stamp (live / paused /
blocked). A wallet holds people, not just keys: team membership with roles
(
owner/admin/viewer), a switcher across every membership, and a viewer who can read everything and change nothing. - Observe before enforcing a wallet's policy. Observe mode records what the engine would have done while relaxing that wallet's own policy and caps. Ancestor subtree caps remain enforced and count observed spend; freeze and authentication checks still apply. Review would-be denials and their cost, then flip each pool to enforce in one confirm-gated click.
- Spend answerable to outcomes. Report outcomes (
POST /outcomes) and a wallet over its cost-per-outcome ceiling throttles to human-gated spend. Wallets can be frozen outright, and budget reallocated across the tree. - LLM gateway. Point your model SDK's base URL at
https://getsanction.com/api/gateway/<provider>withx-sanction-key— usage is metered and budget-capped with zero per-call instrumentation.
Every security claim above maps to enforcing code and a regression test in docs/TRACEABILITY.md — 1,100+ tests behind a coverage gate of 90% statements/lines, 94% functions, and 83% branches, including concurrency and Postgres row-level-security suites.
Start from a pack, not a blank policy
Eleven installable policy packs cover the common shapes — Startup defaults,
Coding agent seat, MCP tool governance, Compliance baseline,
Client-safe launch, and No-egress (Sanction Local) among them. GET /policy/packs lists them;
POST /policy/packs/{id}/preview simulates one against your last 30 days of
real decisions before anything changes; apply writes it as a policy revision.
Changing policy in production
Policy edits are never a leap of faith:
- Draft the change (or pick a pack).
POST /policy/simulatereplays your stored decision history under the candidate — see exactly which calls flip and what spend wouldn't clear.- Apply. The edit becomes an immutable revision; every subsequent decision records the revision in force.
- If a decision is ever questioned,
GET /authorize/{id}/evidencere-runs the rules over the stored context and proves the outcome reproduces.
When to use the credential vault
Use Sanction's vault when credentials should flow through the same policy, approval, and audit trail as spend and tools — one clearance model, no separate secrets cluster. Keep your existing Vault or Secrets Manager when you need fleet-scale secret lifecycle management independent of agent governance; Sanction consumes upstream identity and secrets rather than replacing them. Threat model: docs/SECURITY.md.
Distribution
Platform vendors govern agents inside their own walls. Sanction authorizes agents wherever they run. Pick the shortest path to your stack:
The full menu:
- MCP (agent wallet) — paste
https://getsanction.com/mcp(Streamable HTTP,x-api-key) ornpx sanction-mcpin any MCP host. The agent carries the wallet. Wallet Card · guide - AuthZEN PDP — any OpenID AuthZEN 1.0 enforcement point can use Sanction as its decision point, zero custom code (guide)
- TypeScript SDK —
npm install sanction-sdk(source):SanctionClient(agent plane) andSanctionAdminClient(management plane), plus framework adapters (SanctionMiddleware,sanctionTool) - REST API — direct integration, OpenAPI 3.0 spec at
/api/openapi.json(Bedrock-compatible) - AWS Bedrock Action Group — enterprise agent orchestration (setup guide)
- LLM gateway — cross-provider metering with no code changes
Fastest first decision: bash examples/setup.sh — wallet, agent, and a demo
policy in one command, printing the env exports your agent needs
(examples/ has runnable clients to point at it).
Agent wallet · Quickstart · Starter kit · LangChain · CrewAI · Vercel AI SDK · Bedrock Agents · Agent fleets · AuthZEN PDP · Multi-tenant runbook · Notifications
API
Base URL: https://getsanction.com/api/v1 — grouped by workflow. Agent
endpoints take x-api-key pxy_…; management endpoints take the owner's
x-mgmt-key sk_….
Ask permission — the data plane an agent calls:
Escalate to a human — over the line, someone decides:
Carry credentials — scoped mandates instead of raw secrets:
Prove what happened — audit, evidence, reporting:
Shape policy — edit safely, prove impact first (owner):
Run the fleet — wallets, seats, keys (owner):
Speak the standard — AuthZEN PDP + AARP (agent key; base
https://getsanction.com/api — spec-canonical paths):
Full schemas: /api/openapi.json.
MCP setup
The agent carries a Sanction wallet. Discovery: GET /.well-known/wallet-card.json.
stdio MCP is cooperative — the host must ask before acting.
Cursor plugin (MCP + skills): cursor-plugin/.
Stack
Next.js 16 (App Router) + TypeScript · Prisma 7 on Neon Postgres (row-level security enforced at the database) · Vercel · jose (HS256, alg-pinned) · AES-256-GCM envelope encryption with AWS KMS root of trust in production.
Contributing & security
CONTRIBUTING.md gets you from clone to green PR
(npm install && npm run check — no database needed for unit tests).
Security model and disclosure: docs/SECURITY.md.
Vocabulary: docs/DOMAIN.md.
Pricing
It's free, or it's an agreement. Free for individuals — no card, personal and production use. Beyond that, an enterprise agreement shaped to your deployment: SSO, policy administration, audit export, SLA. Talk to us.
License
packages/sanction-mcp(the MCP client) — MIT. Embed it anywhere.- Everything else (server, dashboard, API) — Functional Source License 1.1 (FSL-1.1-MIT). Source-available: use and self-host for any purpose except offering a competing service. Converts to MIT two years after release.
- Commercial use beyond the FSL — Commercial License guide (on-site).
来源:README.md,提交 e37949b
工具
0版本历史
2- v0.10.0最新Oct 3, 2026
- v0.9.0Sep 16, 2026
评分
已满足适用检查项的 75%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通必需25 分
- 已声明认证方式必需10 分
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
请在仓库或注册中心条目中声明许可证。