aws-samples / aws-samples/sample-collaborative-ai-dlc

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

Open
#406 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
75
Forks
23
Avg merge
3d 17h
Merged PRs (30d)
24

Description

### 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_

Contributor guide

Open the contributing guide

Research direction

Start by tracing the AgentCore invocation output paths in the Lambda backend, including stdout, stderr, CloudWatch/container logs, DynamoDB execution output, WebSocket responses, and error messages. Add or locate tests covering direct and chunked secrets, structured output, stdio inheritance, and CloudWatch data-protection policies; done means all listed sinks redact resolved agent credentials and MCP secrets.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, javascript
Domain
backend, observability, security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.