aws-samples / aws-samples/sample-autonomous-cloud-coding-agents
feat(hydration): untrusted content boundaries in prompt assembly
- 主要言語
- TypeScript
- スター
- 143
- フォーク
- 46
- 平均マージ
- 3日 9時間
- マージ済み PR(30日)
- 20
説明
**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 を理解します。外部ブロック用の一貫したマーカーと source/fetched_at メタデータ、system-prompt の境界指示、injection-fixture の golden test、および docs/design/SECURITY.md に記載する設計を追加します。完了の条件は、テストが組み立てられた prompt の動作をカバーしていることです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript
- 領域
- backend-api-design, security
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 52/100