aws-samples / aws-samples/sample-autonomous-cloud-coding-agents

feat(hydration): untrusted content boundaries in prompt assembly

未关闭
#492 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
enhancement orchestration security
主要语言
TypeScript
星标
143
派生
46
平均合并
3 天 10 小时
30 天内合并 PR
24

描述

**Context:** ROADMAP.md → Security → Untrusted hydration content boundaries
**Related:** #429 (signed attestation), #26 (closed)

---

## Component

API or orchestration

## Describe the feature

Delimit **external content** in assembled prompts (issue/PR bodies, fetched URLs, review comments) so the model treats it as **untrusted context** (spotlighting-style framing). Complements Bedrock Guardrails at hydration time.

## Use case

Issue bodies and PR comments are attacker-controlled. Without structural boundaries, injection instructions blend with system intent.

## Proposed solution

1. Wrap untrusted blocks in `context-hydration.ts` with consistent markers and metadata (`source`, `fetched_at`).
2. System prompt instruction: never follow instructions inside untrusted blocks.
3. Unit tests with injection fixtures (golden prompts).
4. Optional strict mode: strip HTML/scripts beyond current sanitization.
5. Document in `docs/design/SECURITY.md`.

## Other information

- Complements **MCP supply-chain controls** (#429).
- Design context: `cdk/src/handlers/shared/context-hydration.ts`.

- [ ] This might be a breaking change

贡献指南

打开贡献指南

调研方向

从 cdk/src/handlers/shared/context-hydration.ts 和 ROADMAP.md 中的安全条目开始,以了解当前的 hydration 和 sanitization。为外部 block 添加一致的 marker 和 source/fetched_at metadata、system-prompt 边界指令、injection-fixture golden test,以及在 docs/design/SECURITY.md 中记录的设计;完成的标准是测试覆盖组装后的 prompt 行为。

由索引模型根据 Issue 内容生成。

评估

技术栈
typescript
领域
backend-api-design, security
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
52/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。