other
- Location
references/patterns.md:7- Finding
Excessive Parallel Agent Delegation Can Exhaust Resources
- Content
View full analysis
Vulnerability Details
File Location:
references/patterns.md:7-10
Vulnerability Type: Uncontrolled resource consumption
Risk Level: MediumComplete Code Snippet:
markdown ## Discovery Sub-agents learn patterns during Phase 0c of the loop: > "Study src/lib/* with up to 250 parallel Sonnet subagents to understand shared utilities & components"Technical Analysis
The Skill recommends using up to 250 parallel model sub-agents for routine source-code discovery. This concurrency level is disproportionate to the stated task and lacks safeguards such as a conservative default, explicit user approval, account-level budget enforcement, rate limiting, bounded queues, or early cancellation.
If an agent follows this instruction literally, it may create a large burst of model requests. Although this is not evidence of malicious intent and does not grant operating-system privileges, it creates a resource-exhaustion risk affecting API quotas, financial budgets, and service availability.
Attack Path
- A user activates the Skill on a project containing a
src/libdirectory. - The discovery phase reads and follows the quoted recommendation.
- The orchestrating agent launches as many as 250 sub-agents concurrently.
- Each sub-agent consumes model tokens, request capacity, and session resources.
- The burst exhausts quotas, triggers throttling, incurs unexpected charges, or degrades availability.
- Repeated activation can reproduce or amplify the impact.
Impact Assessment
No additional system privileges are obtained. The affected scope is resource availability and cost within the user's model account or agent platform. Potential consequences include quota exhaustion, unexpected API charges, rate limiting, delayed legitimate workloads, and temporary denial of service for other sessions.
- A user activates the Skill on a project containing a
- Remediation
View remediation
Remediation Suggestions
- Replace the 250-agent recommendation with a conservative default, such as two to four concurrent workers.
- Require explicit user confirmation before increasing concurrency beyond the default.
- Enforce hard limits for concurrent sessions, total spawned agents, token consumption, elapsed time, and monetary cost.
- Use a bounded work queue rather than launching all workers simultaneously.
- Cancel outstanding workers once adequate discovery coverage has been achieved.
- Add exponential backoff and handling for rate-limit responses.
- Record agent count and estimated resource consumption in the progress log.
- Prefer deterministic local indexing or search tools for initial source discovery and reserve sub-agents for narrowly scoped analysis.
