Skip to main content

Data protection

Data labels let you define what must not leave through an agent: personal data, customer identifiers, project codenames, anything that would be a breach if it appeared in a prompt, a log or a tool call. AgentShield scans shell commands and MCP tool arguments for them before the action runs.

Three kinds of detector

DetectorUse it forNotes
Regex with contextStructured values such as SSNs, card numbers, account idsAn optional context keyword (for example ssn near the number) removes most false positives. Patterns are compiled once at startup.
KeywordsCodenames, customer names, internal hostnamesScanned in a single pass with an Aho-Corasick automaton: microseconds, however many keywords you add.
ValidatorsValues a regex matches too looselyA Luhn check rejects random digit runs that look like card numbers. Validators are pluggable.

Defining a label

# policy.yaml
data_labels:
- id: pii-ssn
decision: BLOCK
patterns:
- regex: '\b\d{3}-\d{2}-\d{4}\b'
context: "ssn|social.security"
- id: project-codenames
decision: AUDIT
keywords: ["Project Kestrel", "kestrel-prod"]
scope:
tools: ["write_file", "http_request"]

Labels can be scoped to specific MCP tools or to direction (arguments going to a server, results coming back). When no labels are defined the layer costs nothing.

Where it runs

Data labels are the seventh analyzer layer, after the structural and dataflow layers, so a label can also catch a secret that was read from a file and is now on its way to the network. See the policy guide.

Plans

Custom data labels are an Enterprise feature. Every plan gets the built-in credential-path and secret-in-argument protections.