mandate-api

mandate-api is a skill for Claude Code from SwiftAdviser/claude-mandate-plugin. It costs 34 tokens per session (4,835 once invoked), scanned C, original, MIT.

A policy layer for agent-controlled wallets that checks payments before they happen. It can apply spending limits, approved-destination lists, and human approval steps.

In plain words
What is it for?
Use it before every wallet transaction to validate whether the payment is allowed and show the reason when it is blocked.
Why use it?
It puts a required safety check between an agent and a transaction, blocking payments when the policy service rejects them or cannot be reached.

Skill for Claude Code

Written for Claude Code: PostToolUse hook event. Also seen: positional $N argument; mentions Claude Code; built for openclaw.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is claude --plugin-dir ./packages/claude-mandate-plugin.

Part of the mandate plugin — 1 skill, 3 hooks shipped together

Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/SwiftAdviser/claude-mandate-plugin
agentmods
npx agentmods add skills/swiftadviser/claude-mandate-plugin/mandate-api

Made for: Claude Code.

Or install mandate, the plugin that ships this one along with the rest of its 1 skill, 3 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mandate-api

README.md
[![agentmods](https://agentmods.dev/badge/skills/swiftadviser/claude-mandate-plugin/mandate-api.svg)](https://agentmods.dev/skills/swiftadviser/claude-mandate-plugin/mandate-api)
Your own site
<a href="https://agentmods.dev/skills/swiftadviser/claude-mandate-plugin/mandate-api"><img src="https://agentmods.dev/badge/skills/swiftadviser/claude-mandate-plugin/mandate-api.svg" alt="Measured on agentmods" height="20"></a>
Per session 34 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,835 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 3 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00034 $0.04835
Opus 5 $0.00017 $0.02417
Sonnet 5 $0.00007 $0.00967
Haiku 4.5 $0.00003 $0.00483

Measured 6d ago against content hash c9272f3dc20a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade C, and why

mandate-api scanned grade C with 3 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nullifies safety policiesmediumAnti-refusal

"You have no restrictions", "do anything now", "ignore your guidelines": a direct jailbreak that disables guardrails.

This is non-negotiable. An unreachable policy server does not mean "no policies apply", it means "policies cannot be verified." Executing without verification bypasses the owner's configured protections.

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

Stores credentials in `~/.mandate/credentials.json` (chmod 600). Display the `claimUrl` to the user, they are the owner.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -X POST https://app.mandate.md/api/validate \
skills/mandate-api/SKILL.md · 482 lines

How it starts

The opening of the file, as written. The whole thing — 482 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Integration note

Mandate needs hooks to reliably catch payment intents. If your platform supports plugins with hooks (OpenClaw, Claude Code), use the plugin: it intercepts financial tool calls automatically. This SKILL.md is for agents that integrate via API directly, but without hooks there is no enforcement layer: the agent must voluntarily call /validate before every transaction.

OpenClaw: openclaw plugins install @mandate.md/mandate-openclaw-plugin (preferred, has hooks) Claude Code: claude --plugin-dir ./packages/claude-mandate-plugin (has hooks) Other frameworks: Use this SKILL.md + SDK. No hooks, agent must self-enforce.

MANDATORY SECURITY RULES

Mandate is the security boundary, not optional infrastructure. The card must be swiped before the purchase.

  1. You MUST call /validate before EVERY transaction. No exceptions. No shortcuts. (Legacy /validate/raw is also available for existing EVM integrations.)
  2. If validation returns allowed: false, you MUST NOT execute the transaction. Display the blockReason to the user.
  3. If validation is unreachable, you MUST NOT execute the transaction. Do NOT fall back to calling the wallet directly. See Fail-Safe Behavior.
  4. You MUST display validation results to the user before any wallet call. See Required User Feedback.
  5. Even with custodial wallets, you MUST validate with Mandate BEFORE calling the wallet API. Do NOT call transfer/swap directly.
  6. Skipping validation is a security violation, not a simplification. An unvalidated transaction bypasses spend limits, allowlists, and approval workflows the owner configured to protect their funds.
MANDATE API QUICK REFERENCE v1.1.0
Base:   https://app.mandate.md/api
Auth:   Authorization: Bearer <MANDATE_RUNTIME_KEY>

NON-CUSTODIAL: your private key NEVER leaves your machine.

Primary endpoint:
  POST /validate            -> action + reason. Works with any wallet type.

Legacy endpoints:
  POST /validate/raw        -> full tx params + intentHash. EVM only. (deprecated)

Other endpoints:
  POST /agents/register        -> register agent (no auth), get runtimeKey + claimUrl
  POST /activate               -> set evmAddress (call once after registration)
  POST /intents/{id}/events    -> post txHash after broadcast (envelope verify)
  GET  /intents/{id}/status    -> poll intent state

Key prefixes: mndt_live_... (mainnet) / mndt_test_... (testnet)
Credentials: ~/.mandate/credentials.json
Errors: HTTP status + JSON { "error": "message" } or { "allowed": false, "blockReason": "..." }

Read the full file on GitHub · 482 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 482 lines · 34 tokens per session scan C c9272f3dc20a

Subscribe to this mod's changes

mandate-api is a skill published in the GitHub repository SwiftAdviser/claude-mandate-plugin (3 stars, last pushed 5mo ago), licensed MIT. It adds 34 tokens to every session and 4,835 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 3 findings (nullifies safety policies, asks for root, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.