How it works
Garm assumes the agent will sometimes be hijacked by a prompt injection, and that injection classifiers will miss some attacks. It doesn’t try to detect the hijack. It makes sure a hijacked agent can’t move sensitive data out.
Labels
Everything a tool returns gets a label with two parts:
| Part | Values (low → high) | Combines as |
|---|---|---|
| Confidentiality | public < internal < confidential < secret | the highest seen |
| Integrity | untrusted < partner < trusted | the lowest seen |
Labels can also carry tags, such as pii. Labels come from your policy (or a
label pack), never from the MCP server or the model: a server’s own hints,
like readOnlyHint, are ignored. A tool the policy doesn’t mention is treated as untrusted and
internal, so unknown tools fail closed.
The session label only goes up
Each result raises the session label, and it never comes back down. After the agent reads a
.env file, the whole session is secret, even if the model later paraphrases the key into
words no detector would recognise. That’s what per-call DLP misses: the leaking call often looks
harmless on its own.
Under garm run, every MCP server the agent uses shares this one session.
DLP
Garm scans what tools return, to raise labels (a file that holds an AWS key makes the session
secret), and what the agent sends, to catch values on their way out. It looks for cloud keys,
tokens, private keys and PII (email addresses, card numbers, US SSNs, Indian PAN and Aadhaar
numbers), and decodes base64, hex, URL encoding and gzip, nested up to four layers. Findings
record the kind and position, never the value.
Sinks and decisions
Every outbound call goes to a sink with a clearance (the most confidential data allowed there) and a flag for whether it leaves your organisation. Before a call is forwarded, Garm compares the session label with the sink:
- trifecta (built in): untrusted content, internal or more sensitive data, and an external sink → hold.
- clearance (built in): the session is more confidential than the sink is cleared for → hold.
- Your own rules can
redact,holdorblock. The most severe matching rule wins, so rule order doesn’t matter and a higher session label never gets a looser decision.
A held or blocked call never reaches the server. The agent gets a tool error that says why. Approving held calls is planned; today a hold stops the call.
If Garm fails
Garm fails closed. A message it can’t parse is rejected rather than forwarded. If a proxy loses
contact with the garm run session, it treats the session as secret and untrusted, so calls to
external sinks are stopped. Every decision is written to the
audit log.