An independent explainer for agentveil-protocol's agentveil-sdk — built to help you actually implement it.

source github.com/agentveil-protocol/agentveil-sdk

agentveil-sdk
Action Control for AI Agents

AI agents can do things now. Control what they do.

AgentVeil is an independent action-control layer that sits between AI runtimes and the real world — intercepting, classifying, and controlling agent actions before they execute.

Works with Cursor, Claude Code, Codex, and Gemini CLI — the AI coding tools your team already uses. One install. Local evidence. No cloud required.

An independent explainer for agentveil-protocol's agentveil-sdk — built to take you from "never seen it" to "ready to implement".

PyPI 0.7.29Python 3.10-3.13License SDK: MIT / Proxy: source-available
agentveil-sdk: A glowing checkpoint gate in a dark digital corridor: streams of AI agent signals approach, each passing through a luminous sentinel panel that sorts them — green for allowed, amber for approval-pending, red for blocked — while a tamper-evident receipt falls for each decision.
01

The risk is not what AI says. It is what AI does.

Why does this exist?

AI agents now write your files, commit to your repos, install packages, and execute shell commands — often in tight loops, faster than you can follow.

Picture this: you ask Claude Code to "clean up this module" and your agent quietly rewrites three files, renames a function used across the codebase, and runs npm install — all in two seconds, while you were still reading the first response. That is not a bug. That is the default behavior. The agent had access and it used it.

Every major AI coding tool gives agents direct hands on your file system, your terminal, and your tools. There is no standard checkpoint between when an agent decides to act and when it executes. If the agent makes a wrong call, there may be no record, no way to require review, and no receipt to show what actually ran. The risk is not that AI is untrustworthy. It is that there is no gate.

The problem agentveil-sdk: the problem

The risk shiftAI agents used to give advice. Now they take action. AgentVeil is the checkpoint between deciding and doing.

02

A control layer, not a replacement.

What does it actually do?

AgentVeil adds one thing: a checkpoint between your AI agent and the actions it takes. It does not replace your AI runtime. It mediates the actions your agent is configured to route through it.

Every routed action gets one of four decisions: allow (proceed immediately), redirect (retry through the controlled service route), approval required (wait for a human), or hard block (this one does not run).

Every decision gets a signed, local, bounded evidence record — what was requested, what was decided, a payload hash — without storing raw file content or secrets. The record is yours, stored locally, no cloud required for the core proxy.

The big idea AgentVeil system diagram: an AI agent makes a tool call, which hits the AgentVeil Checkpoint. The checkpoint classifies the action type and applies policy rules. It returns one of four decisions: allow, redirect, approval required, or hard block. Allowed actions proceed to the downstream tool and produce bounded local evidence.
The four decision outcomes
DecisionWhat happensAgent receives
AllowAction proceeds to downstream toolNormal tool response
RedirectNative action blocked; retry through the controlled service routeRedirect guidance
Approval requiredHuman approval request created; execution pausesPending state until approved or denied
Hard blockAction denied; no execution path availableBlock decision with reason
03

The clever move: intercept at the tool boundary, not inside the model.

Why is it elegant?

Most AI safety work happens at the model level — system prompts, output filters, guardrails. Those address what the AI says. AgentVeil addresses what the AI does.

AI agents use tools to act. Those tool calls cross a boundary: from agent runtime to environment. If you sit at that boundary — between the agent and the tool execution — you can classify, decide, and record every action without touching the model itself.

For AI coding tool connectors, this is a project-local hook that fires before native file-write and edit operations execute. For calls to external services, this is a proxy that wraps those services. In both cases: the agent sees a gate, not a guardrail. The model is untouched. The boundary is enforced.

The aha Insight diagram: every AI agent action is a tool call that crosses a boundary from agent runtime to environment. Sitting at that boundary, you can classify every call and record every decision without touching the model. No model changes needed.

The gate is at the tool boundary — so it works with any AI runtime that uses tools, without touching the model.

04

How it works: the AgentVeil loop.

How is it built?

Every agent action routed through AgentVeil follows the same five-step path: attempt, classify, decide, control, proof.

Attempt: Your agent tries a risky action — write a file, call an external service, run a command. If it is a native tool (like Claude Code's Write or Edit), the project connector hook fires before execution and blocks the native action with redirect guidance. If it is a routed Model Context Protocol (MCP) call — the standard way AI tools talk to external services — it arrives at the proxy instead.

Classify: The action gets a type (read, write, destructive, unknown) and a risk class. Built-in defaults block or require approval for higher-risk actions — write operations, destructive calls, financial operations.

Decide: Local policy rules return one of four outcomes: allow, redirect, approval required, or hard block. The key invariant: missing policy defaults to denial, never to silent forwarding. If the control system cannot make a trusted decision, it fails closed.

Control: If approval is required, an approval request is created locally and the action pauses. A browser-based approval page opens. The principal (you) reviews the bounded proof details: what the agent asked for, what the payload hash is. You approve or deny. Execution continues only after your explicit sign-off. Approval timeout defaults to deny.

Proof: A tamper-evident evidence record is written to local storage: request ID, action type, risk class, payload hash, decision, timestamp — but never raw file content, prompts, or secrets. A Proof Packet can bundle the signed receipts (delegation, decision, execution) into a single verifiable artifact for audit or compliance review.

Architecture agentveil-sdk module dependency map: 6 components across python wired by 5 internal dependencies, drawn as a layered graph where each arrow points from a module to what it depends on (top entry points down to shared foundation libraries).
Architecture — modules, components and how they depend on each other.
Data flow agentveil-sdk data-flow pipeline: the repo source flows through install (→ dependencies), build (→ compiled artifacts), run the entry point (agentveil-mcp-proxy), and verify (→ pass/fail), with each stage's input and output artifact labelled so you can see what data changes at every step.
Data flow — how a request moves through the system at runtime.
05

Who this is for — and what it looks like in practice.

Could I use this?

AgentVeil is for any developer or team running AI agents that have write access to production systems, codebases, or sensitive data.

In the real world agentveil-sdk in use
06

Set up in one command. See it work in five minutes.

How do I start?

You need Python 3.10 or later and one of the supported AI tools (Cursor, Claude Code, Codex, or Gemini CLI). The whole setup takes under five minutes.

pip install agentveil-mcp-proxy
  1. Set up your project connector Run: agentveil-mcp-proxy setup claude-code --choose-folder --yes A folder picker appears. Choose the project you want to protect. Then reopen or reload Claude Code for that project. (For Cursor: setup cursor --choose-folder. For Codex: setup codex --choose-folder --yes. For Gemini CLI: setup gemini-cli --choose-folder --yes.)
  2. Test it — ask the agent to write a file In Claude Code (in your protected project), type: "Create avp-test.txt with the text hello" What you will see: the native write is blocked with a message telling Claude to retry through the AgentVeil route. Claude retries. An approval page opens automatically in your default browser.
  3. Approve or deny in the browser The approval page shows you exactly what the agent requested: file name, action type, payload hash, and timestamp. Click Approve to allow the write. Click Deny to cancel it. The file is only created after your explicit OK — never before.
  4. Verify your local evidence trail Run: agentveil-mcp-proxy events show --last Expected output includes lines like: decision=approval_required tool=write_file payload_hash=sha256:... timestamp=... That is your local audit trail. No cloud, no external service, no account needed.
07

An AI knowledge pack ships with every explainer.

Does my AI get it too?

Drop the pack into your AI assistant and it can answer deep questions about AgentVeil — how the proxy works, how to write a controlled_action() flow, what a DelegationReceipt contains, how to verify a Proof Packet offline.

# agentveil-sdk-knowledge-pack.zip for-ai/ # wire this into your agent agentveil-sdk-kb.rvf # 384-dim vector brain (semantic search) agentveil-sdk-kb.passages.jsonl # full passage text (search returns TEXT) agentveil-sdk-symbols.json # exact public API agentveil-sdk-dep-graph.json # what depends on what agentveil-sdk-entrypoints.json # build / test / run commands ask-kb.mjs · kb-mcp-server.mjs # CLI + MCP search server for-humans/ # read first agentveil-sdk-primer.md # the human orientation
Download the AgentVeil AI Knowledge PackRVF vector KB + MCP server — drop it into your own agent.
Give your AI the same understandingagentveil-sdk-knowledge-pack.zip