Guardian CLI tool
Background Agent
Install guardian-agent, enroll it with a single-use code, and run MCP tests and scans against servers on your own machine.
guardian-agent is the Guardian background agent. It runs on your machine as you, claims the jobs Guardian queues for it, and runs them only against MCP servers you pinned on that machine. It always uploads the results, labelled Agent and self-reported.
It isn't the guardian CLI. It has no login and no API token: you enroll it once with a single-use code. Admins, Managers and Engineers can add background agents.
Quick start
Download, verify and install the agent from the agent download page. Run it as yourself, never as root.
In Guardian, open Account > Background agents and select Add a background agent. You get a single-use code that starts with gre_ and lasts 15 minutes.
Register the agent. Paste the code at the hidden prompt, check the tenant and the API origin it shows, and answer y:
guardian-agent register
Pin a local MCP server. --server is the entry name in your MCP client config file:
guardian-agent approve --server payments-api --config ~/.config/Claude/claude_desktop_config.json
Start the agent for the servers you pinned. It runs in the foreground:
guardian-agent start --servers payments-api
Check the runner, its expiry and its pins:
guardian-agent status
A runner lasts 90 days. Renew it from Guardian. guardian-agent revoke removes it.
Run tests
Queue a test from Account > Background agents: select Run now, choose MCP test, and enter the name of a server you pinned on that machine. Only read-only cases run. Cases with side effects are always skipped.
If you change the server's config entry or its tool list, run guardian-agent approve again. Until you do, its jobs are refused.
Test a server by URL
You can also test a server by its URL, with no pin. This is off until you turn it on:
guardian-agent allow-url-tests
For a host that isn't on your own machine (not loopback), add its host:port:
guardian-agent allow-host add build.internal:8080
Then restart start, so the agent reports the new consent:
guardian-agent start --servers payments-api
No headers or credentials are sent to the URL. The server's tool list, with descriptions and schemas, goes to Guardian so it can plan the test. Turn it off again with guardian-agent allow-url-tests --off.
URL tests need a guardian-agent release newer than v0.1.1. Pinned MCP tests work on v0.1.1.
Run scans
Each kind of scan is off until you turn it on with its own consent. Restart start after you change one.
MCP scan
guardian-agent allow-scans
guardian-agent approve --server payments-api --config mcp.json --scan
guardian-agent allow-host add build.internal:8080
approve ... --scan confirms a pinned server for scans. Re-run it for a server you pinned earlier. allow-host is only for a server on a non-loopback host.
The server's replies reach Guardian with the secrets the agent knows masked. Guardian also sends them to its AI provider and keeps them in the report. Leave scans off if that isn't acceptable for the server.
Web app scan
guardian-agent allow-site-scans
The agent fetches nine fixed files from a local site you saved in Guardian, such as /robots.txt and /llms.txt, and uploads their masked text. Only recognised secret shapes are masked. Passwords in a page, connection strings, emails and internal host names are not, and a development server's home page often holds them.
Turn either one off with --off, for example guardian-agent allow-scans --off.
MCP scans and web app scans need a guardian-agent release newer than v0.1.1.