Skip to content

Edgee Demo Day · November 10

Register
Agent Gateway
Features

Secret detection

Flag, redact or block credentials in coding-agent traffic before they reach the model provider.

Coding agents read .env files, dump environment variables and paste tokens into prompts. Secret detection scans every request on the gateway and flags, redacts or blocks credentials before they reach the model provider. No agent or CLI change is needed.

Available on the Team plan and above. Open Security in the console sidebar.

TabWhoPurpose
SecretsMembers with access to detections; admins mark false positivesReview and filter detections
Secret detectionMembers who can view organization settings; admins editEnable scanning, choose the mode and actions, add custom rules and allowlists

What is scanned

The gateway scans each request right after it authenticates the key, before routing, compression, debug-log capture or the provider call. Nothing downstream sees a redacted value: not the routing classifier, not debug logs, not the provider.

Scanned surfaces:

SurfaceIncludes
User messageText the developer or agent sends
System promptSystem prompt and instructions
Tool resulttool_result / function_call_output, e.g. a file read or a shell output
Tool calltool_use / function_call arguments

Not scanned or never modified:

  • Model responses.
  • Images, documents and other media blocks.
  • Signed thinking / redacted_thinking blocks. Editing them would break the upstream call, so a hit there is reported as Flag with the reason Signed block.

Scanning is inline and fast: a 200 kB transcript scans in a few milliseconds, and history resent on the next turn is served from a cache.

Actions

Each hit gets one action:

ActionEffect
FlagForward unchanged and report the hit.
RedactReplace the value before it reaches the provider.
BlockReject the request with HTTP 422.

A redacted value keeps its known prefix and the last four characters, e.g. sk_live_[REDACTED:stripe-live:a91f]. The replacement is deterministic: the same content yields the same output on every turn, so the provider prompt cache stays warm.

A blocked request returns:

{
  "error": {
    "type": "secret_detected",
    "rule_id": "aws-access-key",
    "message": "..."
  }
}

Defaults

When no action is set for a severity, the gateway uses:

SeverityDefault action
CriticalRedact
HighFlag
MediumFlag
LowFlag

A per-rule action overrides the severity action. A severity-level Block is downgraded to Flag for High-entropy string unless you set Block on that rule explicitly.

Modes

ModeBehavior
EnforceDefault when enabled. Apply configured actions immediately on save; no grace period.
MonitorReport every hit as flagged. Nothing is redacted or blocked. Never switches to Enforce automatically.

Start with Monitor to measure volume and false positives on real traffic, then switch to Enforce. Events recorded in Monitor show the reason Monitor mode.

Set up secret detection

Enable scanning

Open Security → Secret detection. Turn on Scan agent traffic, choose Monitor for a first rollout, then Save.

Review detections

Let agents run, then open Security → Secrets. Check which rules fire, on which surface and for which members.

Tune rules and allowlists

Disable noisy rules, add allowlist patterns or mark individual values as false positives. Add custom rules for internal credential formats.

Enforce

Set Actions by severity and any per-rule overrides, select Enforce and Save. Actions apply to the next request.

Each section of the settings page saves on its own. A policy change applies to the full conversation history on the next request, which causes one prompt-cache miss for active sessions.

Built-in rules

Rules fall into three classes:

  • Known formats: fixed prefixes such as AKIA or ghp_. Near-zero false positives.
  • Keyword assignments: password=, api_key: and similar, with an entropy check on the value.
  • High-entropy strings: random-looking values. Flag-only by default; the threshold scales with length.
RuleIDDefault severity
AWS access keyaws-access-keyCritical
AWS secret keyaws-secret-keyCritical
GitHub tokengithub-tokenCritical
GitHub fine-grained PATgithub-fine-grained-patCritical
GitLab tokengitlab-tokenCritical
Stripe live keystripe-liveCritical
Stripe webhook secretstripe-webhook-secretHigh
Anthropic API keyanthropic-keyCritical
OpenAI API keyopenai-keyCritical
Google API keygoogle-api-keyHigh
Hugging Face tokenhuggingface-tokenHigh
Groq API keygroq-keyCritical
xAI API keyxai-keyCritical
Edgee API keyedgee-keyCritical
Slack tokenslack-tokenHigh
Private keyprivate-keyCritical
Database URL with passworddb-url-with-passwordHigh
JSON Web TokenjwtMedium
Bearer tokenbearer-tokenHigh
Keyword assignmentkeyword-assignmentHigh
High-entropy stringgeneric-entropyLow

Context rules

Context rules detect risky agent behavior rather than a value. They always Flag, whatever action is configured, and they are not file-access controls.

RuleIDDefault severity
Sensitive file readctx-sensitive-file-readHigh
Environment dumpctx-env-dumpHigh
Dotenv-shaped outputctx-dotenv-shapeMedium

When enabled, a context rule also marks the linked tool result as sensitive, which lowers the keyword and entropy thresholds for values inside it. Disabling the rule removes both effects.

Custom rules

Add patterns for internal credential formats under Security → Secret detection → Custom rules. Custom rules run next to the built-in ones and accept the same per-rule actions, disabling and allowlists.

FieldConstraint
NameUp to 80 characters. Shown in the console only.
Rule IDGenerated from the name: custom- + up to 48 of a-z, 0-9, -. Unique.
PatternRust regex syntax, up to 512 characters, unanchored. No lookaround or backreferences.
SeverityCritical, High, Medium or Low. Defaults to High.

The redacted value is capture group 1 when the pattern has one, the whole match otherwise. Example:

\b(acme_[a-z0-9]{32})\b

Use Test against a sample to paste text and see what each rule would catch. Nothing is sent or saved.

Limits: 50 custom rules per organization. When matches overlap, precedence is known formats → custom rules → keyword assignment → high-entropy string. The gateway skips an invalid rule; it never fails a request because of one.

Allowlists and false positives

Three ways to silence a hit:

MethodWhereScope
Value patternsSecret detection → AllowlistRegex matched against the whole value, e.g. sk_test_.*. Same syntax as custom rules. One per line.
File pathsSecret detection → AllowlistGlob (*, **) on the source path of a tool result, e.g. fixtures/**. Hits from those files are ignored.
False positivesSecrets → row actionsOne exact value, across all rules in the organization. Admins only.

Marked false positives are listed under Secret detection → False positives, where admins can remove them.

Review detections

Security → Secrets shows summary counts (Detected, Critical, Redacted, Blocked) and the detection list with Time, Rule, Severity, Action, Surface, Value, Source, User and Session. Filter by period, severity, rule and action.

A session page also shows the secrets detected in that session.

Event semantics:

  • One event per distinct value and rule in a request, with the strongest action applied (Block > Redact > Flag).
  • Within a session, a value already reported is not reported again. Blocked requests always produce an event, including retries.
  • Reason explains a downgraded action: Monitor mode, Signed block or Allowlisted path.

Limits

  • Model responses are not scanned.
  • count_tokens requests are redacted with the same policy but never blocked and produce no events.
  • Cursor relay traffic and structured decision endpoints are not scanned.
  • Secret detection reduces credential exposure; it does not replace secret scanning in your repositories or rotating a leaked credential.

Troubleshooting

SymptomCheck
Security missing from the sidebarOrganization uses the Agent Gateway
Settings read-onlyAdmin role required to edit
Upgrade prompt shownTeam plan or above
No detectionsScan agent traffic is on and saved; agents run through Edgee
Hits flagged, not redactedMode is Monitor, the hit is in a signed thinking block, or it comes from a context rule
Agent receives HTTP 422A Block rule matched the latest message. Remove the secret and resend
Custom rule never matchesTest it with Test against a sample; check for unsupported syntax such as lookaround

Related: organization, sessions, debug logs.