Quickstart | Concepts | API | Verify | Coverage | Teams | Anchors | Recovery | Human approval in CI | Verifiable audit log | Unattended runs | Approval when unattended | Hooks vs deny | Skip permissions | PreToolUse hook | Deny not working | Headless permissions | MCP human-in-the-loop
Quickstart: put a witness in front of your agent (about 10 minutes)
Deus Witness checks every tool call of your AI agent against a mandate that you signed with a passkey, and gives you a signed receipt for it. This guide takes you from nothing to a verified evidence pack.
Fastest path for Claude Code: deus-witness try (about 2 minutes)
No sign-up form. Needs Claude Code 2.1.295+ and uv (curl -LsSf https://astral.sh/uv/install.sh | sh); macOS, Linux, WSL. In Claude Code run these three commands:
/plugin marketplace add sipkigroup/witness
/plugin install deus-witness@sipkigroup
/deus-witness:try
Then ask Claude anything; the first call that needs you waits on the page. "3 userConfig options not yet set" is expected.
Or, without the plugin, in a terminal: uvx --from deus-witness deus-witness try.
It makes a trial account and opens a browser page. The first call of yours that needs a decision waits on that page. You are asked for a passkey twice (one creates the passkey, one signs the rules), then for the waiting call itself. A trial account nobody claims with a passkey and whose hook never calls is erased after 7 days; an account in use is kept (it is erased only after 90 days with no call from your hook and no sign-in, with a push 14 days before). Free for one person. If this ever changes, existing accounts stay free on the limits in force at that time, and we announce it at least 30 days in advance. The manual path below (about 10 minutes) is for MCP servers.
Only want to look first? Open /demo/ on the same server: five scripted attacks, what the witness decided, an evidence pack you can check in the browser. No account, about a minute. Come back here to connect your own agent.
You need: a browser with passkey support (Chrome, Safari, Edge; a phone via QR also works), Python 3.10+ (with pip or pipx), and Claude Desktop or Claude Code (any MCP client works). The hosted instance at https://witness.sipkigroup.com is the only one today; the server is not published yet.
1. Sign up (1 min)
Open /signup.html, type a display name, press Create passkey, confirm with fingerprint, face or PIN.
Expected: a key card (a few groups of hex) and a key ID. Save a screenshot; it reappears in your evidence pack.
2. Create an agent (1 min)
Dashboard, card Agents: type my-agent into New agent name, leave Preset on demo (mail, purchase, delete, publish), press Create agent.
Expected: a line API key (shown once, copy it now): dwk_... under the form. Copy it into a note now. (Lost it? Delete the agent and create a new one.)
3. Sign a mandate (2 min)
In the agent row choose Create mandate. On the page: tick Allow purchases, Budget per 24 hours 200, Max per single purchase 100 (dollars); tick Allow messages, Allowed recipient domains acme.example; under Closed data phone is a ready checkbox (leave it ticked) and home_address goes into Your own classes as the word home_address; leave Deleting and Publishing as Not specified. Press Review and sign, read the summary (it must show up to 100.00 USD each, 200.00 USD per 24 h, domains: acme.example), press Sign with passkey.
Expected: "Mandate active". Anything you did not list is not allowed.
Shortcut: right after Create agent (preset demo) press Next: sign the example mandate. The Mandate page opens with exactly these values filled in; review them, press Review and sign, then Sign with passkey. Copy the API key first: it is shown only once.
4. Install the client (1 min)
pip install deus-witness
(pipx install deus-witness works too and keeps it out of your other Python projects. If pip complains about an "externally managed environment", use a venv: python3 -m venv ~/dw && ~/dw/bin/pip install deus-witness, then write the full path ~/dw/bin/deus-witness-mcp and ~/dw/bin/deus-witness-demo-tools wherever the commands below say deus-witness-mcp / deus-witness-demo-tools.) Expected: deus-witness-mcp and deus-witness-demo-tools on your PATH. Check: deus-witness-mcp --help.
Fallback if PyPI is not reachable: the same package is served as a wheel by your witness server under /dl/ (file deus_witness-<version>-py3-none-any.whl; pip install <that URL>).
5. Connect your client (1 min)
The proxy wraps any MCP server. The dashboard shows this same example (with your key filled in) right after you create an agent. For a try-out use the bundled demo tools (nothing real happens, each call is appended to effects.jsonl in $DEUS_DEMO_OUT).
Claude Code:
claude mcp add witnessed --env DEUS_WITNESS_KEY=dwk_YOUR_KEY --env DEUS_WITNESS_URL=https://witness.sipkigroup.com --env DEUS_DEMO_OUT=$HOME/dw-demo -- deus-witness-mcp -- deus-witness-demo-tools
Check with claude mcp list (or /mcp inside Claude Code): witnessed must be listed. Claude Desktop (claude_desktop_config.json, restart the app; the file is at ~/Library/Application Support/Claude/ on macOS, %APPDATA%\Claude\ on Windows):
{"mcpServers": {"witnessed": {"command": "deus-witness-mcp",
"args": ["--", "deus-witness-demo-tools"],
"env": {"DEUS_WITNESS_KEY": "dwk_YOUR_KEY", "DEUS_WITNESS_URL": "https://witness.sipkigroup.com", "DEUS_DEMO_OUT": "/Users/you/dw-demo"}}}}
No pip install and no PATH problems (a client that does not see your shell PATH): let uvx run the same proxy,
claude mcp add witnessed --env DEUS_WITNESS_KEY=dwk_YOUR_KEY --env DEUS_WITNESS_URL=https://witness.sipkigroup.com --env DEUS_DEMO_OUT=$HOME/dw-demo -- uvx deus-witness -- deus-witness-demo-tools
(in a JSON config: "command": "uvx", "args": ["deus-witness", "--", "deus-witness-demo-tools"]). Cursor reads the same JSON from ~/.cursor/mcp.json (or .cursor/mcp.json in a project). Cursor's own shell and file-edit tools do not go through MCP; deus-witness doctor lists them as a bypass.
For a real MCP server put its command after --, for example npx -y @modelcontextprotocol/server-filesystem /tmp/sandbox (use the filesystem preset when you create that agent).
6. Try it (2 min)
Ask your agent, one by one. A call that needs your approval makes the proxy wait about 50 s (two long polls of 25 s) before it answers, so the agent looks frozen: this is normal. Allowed and denied calls answer at once.
- "Send an email to colleague@acme.example saying the report is ready." Expected: it works (
allow). - "Send an email to stranger@other.example with my home address." Expected: the tool answers
Blocked by Deus Witness: RECIPIENT (receipt r_...)and nothing is sent. This is the RECIPIENT rule, not the data rule. To see the data rule, add your real home address as a literal under Closed data (dashboard, data patterns, classhome_address) and ask for a mail to colleague@acme.example that contains it: expectedDATA_FORBIDDEN. A paraphrase of the address is not caught. - "Publish 'Hello' to the channel blog." Expected after the wait (the result is marked as an error, but nothing was run):
Action NOT executed: waiting for the owner's approval., thenReceipt (rid): r_..., thenThe owner can approve it at: https://.../approve.html?rid=r_..., thenAfter the owner has approved, retry the exact same call (same tool, same arguments). Do not change the arguments.
7. Approve (1 min)
Open the link (or the dashboard; the link must open on a device that can reach the server: localhost links work only on the machine that runs it; "Waiting for your approval"), read the action and the preview of the text below it (secrets are masked; the preview is shown by the page and is not itself signed; the signature covers a hash of everything the agent sent), press Approve, confirm with your passkey. The page may say "phone": your first passkey already counts as your phone key, so just press Approve. You need a separate phone only if you marked your key "this computer" on Devices, or you want a second device for the sake of safety. Ask the agent to publish again with the same text. Expected: it runs, effects.jsonl has exactly one publish line. Different text or a different channel needs a new approval.
8. Download and verify the evidence pack (1 min)
Dashboard, card Evidence pack, button Download evidence pack (a zip). Then:
unzip deus-witness-evidence-*.zip -d pack && cd pack
pip install cbor2 cryptography
python verify/verify_pack.py . --offline
This runs the checker copy that sits inside the pack: fine for a first look, but a doctored pack can carry a doctored checker. For a check you can rely on, use the checker from the package instead: pip install deus-witness, then deus-witness-verify-pack <pack.zip> --offline --witness-kid=<the key id you fetched from /v1/witness> (see verify.html). Details: verify.html, section 1. Expected last line: RESULT: VALID. A line anchors: NONE on a fresh account is expected: the public time-stamps are added about an hour later, until then the witness alone vouches for the time. Edit any byte of ledger/ledger.cose and run again: RESULT: INVALID. Details: verify.html.
9. Claude Code hook: the built-in Bash, Edit and Write (5 min)
The proxy covers MCP tools only. Claude Code also has built-in tools (shell, file edits, web fetch) that never touch MCP. The hook deus-witness-hook closes that road: Claude Code runs it before each of those calls, the witness judges the call, and it runs only if your mandate allows it. Needs Claude Code 2.1.295 or newer for the fail-closed setting below.
Came here after deus-witness try? The key is already saved in the key file and the trial rules are drafted: skip steps 1 and 2, do step 3 (no key in env needed) and the check in step 4. On this path a call that needs you waits up to 120 s (DEUS_WITNESS_HOOK_WAIT, the same wait as the plugin's), then the agent is told the call waits for your answer and to retry it; touch the passkey on the approval page, and the retry runs.
- In the dashboard, card Agents, create an agent with the preset
claude-codeand copy its key (dwk_...). - Print the recommended mandate for your project and import it:
uvx --from deus-witness deus-witness-hook --print-form /path/to/your/project(afterpip install deus-witnessthe short formdeus-witness-hook --print-form ...works;uvx deus-witness-hookalone does not, the command lives in the packagedeus-witness). On the Mandate page of the agent open Import from JSON, paste it, press Check, then Apply to the form and Review and sign. Nothing is signed by the import. The default form lets writes (Write, Edit, shell redirections) work inside the project and the temp directory only (delete.allow_irreversibleis true there because the witness judges a write as an irreversible delete of its path); add--no-irreversibleto print a read-only form that refuses every write. The form allows WebFetch only to documentation hosts (nogithub.com,raw.githubusercontent.com, gists or pastebins: anyone can publish there, so a request to them can carry your data out); add a host you need on the Mandate page, knowingly. - Put this into
<project>/.claude/settings.json(or~/.claude/settings.json):
{"hooks": {
"SessionStart": [{"hooks": [{"type": "command", "command": "uvx --from deus-witness deus-witness-hook --session-start", "timeout": 60}]}],
"PreToolUse": [{"matcher": "Bash|PowerShell|Edit|Write|MultiEdit|NotebookEdit|NotebookRead|Read|Grep|Glob|LS|WebFetch|WebSearch|ReadMcpResourceTool|ListMcpResourcesTool|mcp__.*",
"hooks": [{"type": "command", "command": "uvx --from deus-witness deus-witness-hook || exit 2", "timeout": 140, "onFailure": "block"}]}]},
"env": {"DEUS_WITNESS_URL": "https://witness.sipkigroup.com", "DEUS_WITNESS_HOOK_TIMEOUT": "130", "DEUS_WITNESS_HOOK_WAIT": "120"}}
The key does not go into this file: export DEUS_WITNESS_KEY=dwk_... in the shell that starts claude, or put it under env in <project>/.claude/settings.local.json. With the package installed by pip/pipx write deus-witness-hook instead of uvx --from deus-witness deus-witness-hook.
- Check:
uvx --from deus-witness deus-witness-hook --doctor "$PWD"must printOK: fail-closed (onFailure block, || exit 2, timeouts in order); in Claude Code/hookslists the hook. Then ask Claude Code to runcurl https://evil.example/x: expectedBlocked by Deus Witness: RECIPIENT(if you have already added the step 5 rules below, Claude Code refusescurlitself, before the witness is asked; that is the second layer working). A command that needs you (for examplerm -rf build) is held: the hook answersdenywith the approval link, because the owner approves in Deus Witness (on the phone), not the person at the terminal. Retry the same command after you approved it.
- Add a second layer: Claude Code's own
permissions.deny(recommended). Merge this into the samesettings.json(next tohooks):
{"permissions": {"deny": [
"Bash(curl *)", "Bash(wget *)", "Bash(nc *)", "Bash(ncat *)", "Bash(telnet *)", "Bash(ssh *)", "Bash(scp *)", "Bash(sftp *)", "Bash(rsync *)",
"Bash(/usr/bin/curl *)", "Bash(/usr/local/bin/curl *)", "Bash(/opt/homebrew/bin/curl *)", "Bash(curl -K*)", "Bash(curl --config*)",
"Bash(/usr/bin/wget *)", "Bash(/usr/local/bin/wget *)", "Bash(/opt/homebrew/bin/wget *)",
"WebFetch(domain:gist.github.com)", "WebFetch(domain:gist.githubusercontent.com)", "WebFetch(domain:raw.githubusercontent.com)",
"WebFetch(domain:pastebin.com)", "WebFetch(domain:transfer.sh)", "WebFetch(domain:webhook.site)",
"Read(.env)", "Read(.env.*)", "Read(~/.ssh/**)", "Read(~/.aws/**)", "Read(~/.gnupg/**)",
"Edit(.claude/**)", "Edit(~/.claude/**)", "Edit(.mcp.json)", "Edit(~/.claude.json)"
]}}
Why: Claude Code evaluates deny rules first and "PreToolUse hook decisions don't bypass permission rules" (code.claude.com/docs/en/permissions, section "Extend permissions with hooks"), so these rules hold even if the hook is missing, broken, switched off, or the witness answers pass for a call. They close the direct ways out of the machine (network tools, hosts where anyone can publish, SSH keys, .env files) and stop the agent from editing the settings that switch the hook off (.claude/**, .mcp.json, ~/.claude.json). Limits you should know: a Bash rule "matches the command text Claude writes ... and isn't a security boundary around the program" (env curl, curl -sK or sh -c 'curl ...' are not matched; the common absolute paths are listed above; same page, "What a Bash rule doesn't match"), so this is a second layer behind the witness, not a replacement; for enforcement that does not depend on the command text use Claude Code's sandbox (network allowlist). Bash(curl *) also stops harmless curl calls: the agent reads allowed documentation with WebFetch instead (your mandate lists the domains). Edit(.claude/**) means you change your own settings by hand, not through the agent. Claude Code warns at startup about rules it does not understand (for example an unknown tool name).
The three layers of the setting belong together: the hook answers deny itself on every error it can catch; || exit 2 blocks when the command is missing or broken; "onFailure": "block" blocks on a timeout or a crash (Claude Code below 2.1.295 silently drops that key, the SessionStart hook then warns you at every start). Keep DEUS_WITNESS_HOOK_TIMEOUT at least 5 s below timeout. DEUS_WITNESS_HOOK_WAIT lets a call wait up to 120 s for your answer (and for your first touch on a trial account that is not claimed yet), instead of being refused at once: about what a person needs to reach the phone, sign in, read Details and touch twice. What the witness sees of these calls and what leaves your machine: coverage.html.
Without an MCP client: a script instead (3 min)
No Claude Desktop, no Claude Code? Steps 1 to 4 are the same (account, agent and key, mandate, pip install deus-witness); then the SDK does what the proxy does: it asks the witness, checks the signed receipt, and waits for you. Put this in try_witness.py:
import os
from deus_witness import Witness
w = Witness(os.environ["DEUS_WITNESS_URL"], os.environ["DEUS_WITNESS_KEY"])
r = w.act("send_email", {"to": "colleague@acme.example", "subject": "Report", "body": "It is ready."})
print("1:", r.verdict, r.reason) # allow OK (the receipt was checked)
r = w.act("send_email", {"to": "stranger@other.example", "subject": "Hi", "body": "x"})
print("2:", r.verdict, r.reason) # deny RECIPIENT, nothing is sent
call = ("publish", {"channel": "blog", "text": "Hello"})
r = w.act(*call)
print("3:", r.status, "approve here:", r.approval_url) # pending_approval: open the link, press Approve
r = w.wait(r.rid, timeout=300, sent=call) # waits until you decide
print("4:", r.verdict, r.reason) # allow OK_APPROVED (Refuse gives deny REFUSED)
Run it with your key:
DEUS_WITNESS_URL=https://witness.sipkigroup.com DEUS_WITNESS_KEY=dwk_YOUR_KEY python3 try_witness.py
The script prints 3: and the link, then waits. Open the link, press Approve; it prints 4: allow OK_APPROVED. Your own code does the real action (send the mail, publish) only after allow. With a local server use its address (for example http://localhost:8810), and open the link on the same machine.
Just curl? The same request without the receipt check (the script verifies the receipt; curl does not):
curl -s https://witness.sipkigroup.com/v1/actions -H "Authorization: Bearer dwk_YOUR_KEY" -H "content-type: application/json" \
-d '{"tool":"publish","args":{"channel":"blog","text":"Hello"}}'
The answer has "status":"pending_approval", rid and approval_url. After you approve, ask again with the same body (same text): "verdict":"allow", "reason":"OK_APPROVED". GET /v1/actions/<rid>?wait=25 (same header) waits up to 25 s for your decision.
Troubleshooting
deus-witness-mcp: command not foundin the client: the client does not see your shell PATH; use the full path of the command (which deus-witness-mcp).- Passkey prompt does nothing: open the site by its exact host name (not by IP); passkeys are bound to the name.
deus-witness-mcp: set DEUS_WITNESS_KEY ...(the proxy does not start) orWITNESS_NOT_CONFIGURED(the hook): no agent key in the environment of the client. Create an agent (step 2) and put its key intoDEUS_WITNESS_KEY.Blocked ... BAD_KEY: the witness answered and refused the key (wrong, or the agent was deleted). The call did not run. A trial account (fromdeus-witness try): run/deus-witness:tryin Claude Code; it runs even now, makes a new trial account and keeps the old key file asagent-key.json.<time>.bak. An account you signed up for: create a new agent on the Agents page and use its key.Blocked ... WITNESS_UNAVAILABLE: the witness could not be reached (network, server down, rate limit); the code after it says which. The call did not run.Blocked ... NO_MANDATE: sign a mandate for that agent first.- Tool says
unreachableand is blocked: by design the proxy fails closed when the witness cannot be reached. - Pending approvals expire after 15 minutes.
What this does not do
Read the honest limits in concepts.html before relying on it. Short version: it covers only calls that pass through the proxy, the passkey cannot show you the mandate (you trust the page), and data matching is literal.