Skip to content

[Feature]: Redact agent and MCP secrets from Agentcore output #406

Description

@jeromevdl

Description

AgentCore injects agent credentials and MCP secrets into CLI environment variables. Agent or tool output may accidentally expose these values through stdout or stderr.

Add per-invocation secret redaction before output reaches:

  • CloudWatch/container logs
  • DynamoDB execution output
  • WebSocket clients
  • Error messages and captured stderr

Requirements:

  • Redact resolved agent credentials and MCP secret values.
  • Handle secrets split across stream chunks.
  • Recursively redact structured output.
  • Ensure stdio: inherit cannot bypass redaction.
  • Add CloudWatch Logs data-protection policies as defense in depth.
  • Add tests for stdout, stderr, structured output, and chunk boundaries.

Redaction protects against accidental disclosure. It is not a security boundary against deliberate encoding or exfiltration by an unrestricted agent.

Use case

Secure logs

Area

Backend (Lambda)

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions