aws-samples / aws-samples/sample-autonomous-cloud-coding-agents
feat(security): behavioral circuit breaker with containment
- Ngôn ngữ chính
- TypeScript
- Star
- 143
- Fork
- 46
- Merge trung bình
- 3 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 24
Mô tả
**Context:** ROADMAP.md → Security → Behavioral circuit breaker
**Related:** #390, #428, #251, emergency-session-containment draft
---
## Component
Agent (Python runtime)
## Describe the feature
Per-session limits on:
- **Tool-call rate**
- **Cumulative cost**
- **Consecutive failures**
- **File churn**
On trip: pause or **terminate** session, **revoke short-lived credentials** where applicable, emit **`containment` audit event**. Configurable per repo via Blueprint (`SECURITY.md`, `REPO_ONBOARDING.md`).
**Design principle:** prefer hard containment over friction-only limits (rate/turn caps alone). Pairs with emergency session containment APIs.
## Use case
Runaway agents (infinite tool loops, runaway edits, budget burn) need automated stop—not just logging. Operators want repo-specific thresholds aligned with risk.
## Proposed solution
1. In-agent monitor (hooks + runner) tracking rolling windows.
2. Blueprint thresholds per signal; defaults conservative.
3. On trip: call orchestrator containment path → emergency session containment APIs.
4. `containment` event to `TaskEventsTable`; optional Slack/GitHub notify.
5. Tests for each trip reason and recovery (operator resume).
## Other information
- #390/#428 are adjacent RFCs; this is the **productized circuit breaker**.
- Design context: `docs/design/SECURITY.md`, `docs/design/REPO_ONBOARDING.md`.
- [ ] This might be a breaking change
Hướng dẫn đóng góp
Hướng nghiên cứu
Đọc ROADMAP.md và ngữ cảnh thiết kế trong docs/design/SECURITY.md và docs/design/REPO_ONBOARDING.md, sau đó lần theo các agent hooks, runner, đường đi containment của orchestrator, các emergency session containment APIs và TaskEventsTable. Xác định và kiểm thử từng lý do kích hoạt, hành vi thu hồi credential và sự kiện containment, các tùy chọn thông báo, cũng như khả năng khôi phục khi operator resume.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- python
- Lĩnh vực
- backend, security
- Loại issue
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 30/100