{
  "slug": "secrets-leaking-into-agent-logs",
  "title": "Stopping credentials leaking when an agent shares logs",
  "description": "Agents paste logs, environment files and stack traces into models, tickets and chat. Anything in a URL or an env var goes with them.",
  "keywords": [
    "secret in logs",
    "redact credentials",
    "api key leaked",
    "safe to paste",
    "agent security",
    "pii redaction"
  ],
  "cause": [
    "A URL is the least private place to put a secret. It is written to server logs, proxy logs, browser history and Referer headers — none of which the transport encryption covers.",
    "An agent forwarding output it has not read will forward whatever is in it. The credential reaches a third party, and unlike a file it cannot be recalled.",
    "Detection has to cover both halves: the value must be found, and it must be masked everywhere it is then reported. Those drifting apart is how a scanner leaks the thing it just flagged."
  ],
  "example": {
    "label": "Scan an environment file and get a redacted copy back",
    "curl": "curl -sX POST https://fluentedi.com/v1/secret/scan -H 'content-type: application/json' \\\n  -d '{\"text\":\"DATABASE_URL=postgres://admin:hunter2@db:5432/app\\nAPI_TOKEN=ghp_16C7e42F292c6912E7710c838347Ae178B4a\"}'",
    "output": "\"risk\": \"critical\", \"finding_count\": 4,\n\"findings\": [\n  { \"line\": 1, \"type\": \"connection_string\" },\n  { \"line\": 2, \"type\": \"github_token\" }\n],\n\"redacted\": \"DATABASE_URL=post************/app\n             API_TOKEN=ghp_************8B4a\""
  },
  "fix": [
    "Scan before sharing, not after. The moment to call this is between producing output and forwarding it.",
    "Treat anything flagged as compromised and rotate it. A credential that reached a log has reached everything downstream of that log.",
    "Detection is pattern-based, so a clean result is not proof — a bespoke credential format matches nothing. Use it to catch the common cases, not to certify safety."
  ],
  "tools": [
    "https://fluentedi.com/v1/secret/scan",
    "https://fluentedi.com/v1/url/scan",
    "https://fluentedi.com/v1/jwt/decode"
  ]
}