- Location
- SKILL.md:52
- Finding
- Sandbox Agent Is Granted Excessive Session and Agent-Orchestration Capabilities<![CDATA[
## Vulnerability Details
**File Location**: `SKILL.md`, lines 52-75
**Vulnerability Type**: Excessive agent permissions and session visibility
**Risk Level**: Medium
### Vulnerable Code
```json
"sessionToolsVisibility": "all",
```
```json
"alsoAllow": ["message", "sessions_send", "sessions_list", "sessions_history"],
```
```json
"allow": [
"exec", "process", "read", "write", "edit", "apply_patch",
"image", "web_search", "web_fetch",
"sessions_list", "sessions_history", "sessions_send", "sessions_spawn",
"subagents", "session_status", "message", "browser"
],
```
### Technical Analysis
The sandbox receives visibility into all session tools together with permission to list sessions, inspect session history, send messages, spawn sessions, invoke subagents, browse the web, and execute commands.
These permissions exceed the minimum needed for the declared hub-and-spoke collaboration model. In particular, `sessions_history` may expose conversation content available within the configured visibility scope, while `sessions_send`, `sessions_spawn`, and `subagents` allow the sandbox to influence or initiate other agent workflows.
Per-agent `agentToAgent.allow` restrictions provide some protection, but broad session visibility and orchestration capabilities increase the consequences of prompt injection or compromise. This also conflicts with the stated objective of isolating sandbox agents from main-agent private data.
### Attack Path
1. An attacker sends adversarial content to the sandbox through Discord, shared files, browser content, or another accepted input.
2. The sandbox follows the malicious instruction or is otherwise compromised.
3. It invokes `sessions_list` to enumerate accessible sessions.
4. It invokes `sessions_history` to retrieve any conversation content permitted by the broad visibility configuration.
5. It uses `sessions_send`, `sessions_spawn`, `subagents`, or `message` to influence trusted agents or create additional activity.
...[truncated 684 chars]
- Remediation
- <![CDATA[
## Remediation Suggestions
- Change `sessionToolsVisibility` from `all` to the narrowest supported visibility scope.
- Remove `sessions_history` and `sessions_list` unless the sandbox has a documented need to inspect existing sessions.
- Remove `sessions_spawn` and `subagents` unless autonomous agent creation is an explicit requirement.
- Permit `sessions_send` only to the specific main agent required by the hub-and-spoke design.
- Expose a constrained collaboration API that accepts narrowly defined messages instead of general session-management tools.
- Apply per-agent and per-session authorization checks to every session operation.
- Prevent sandbox-accessible histories from containing secrets, private user data, or credentials.
- Log and rate-limit session enumeration, history access, message sending, and agent spawning.
- Test the final policy with a hostile sandbox prompt to confirm that unrelated sessions and agents remain inaccessible.
]]>