Back to skill

Security audit

Claude Code Agent Teams

Security checks for vulnerabilities and agentic risk

Overview

This is mostly a clear Claude Code team-orchestration helper, but its force cleanup script can terminate more Claude sessions than intended.

Review scripts/team-cleanup.sh before use. Avoid running ./scripts/team-cleanup.sh --force --yes unless you have no other Claude PTY sessions and accept possible loss of in-progress work. Expect spawned agents to have the same repository/task context you provide and higher token usage.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/team-cleanup.sh:172
Finding

Broad Process Matching Can Terminate Unrelated Claude Sessions

Content
View full analysis
/dev/null; then return 0 else return 1 fi } ``` ```bash echo "Terminating Claude Code processes..." if pkill -f "claude.*pty"; then echo -e "${GREEN}✅ Processes terminated${NC}" else echo -e "${YELLOW}⚠️ No processes found${NC}" fi ``` ### Technical Analysis The cleanup script uses `pgrep -f` and `pkill -f` with the regular expression `claude.*pty`. The `-f` option matches against each process's complete command line rather than a precisely tracked process identifier. This pattern is not tied to the specific agent-team session managed by the Skill. Consequently, it may select every same-user process whose command line contains `claude` followed later by `pty`, including unrelated Claude sessions. The script also supports `--force --yes`, allowing termination to proceed without an interactive confirmation. This is an unsafe process-management practice rather than evidence of deliberately malicious code. The command normally remains constrained by the invoking user's operating-system permissions and does not itself provide privilege escalation. ### Attack Path 1. A user has multiple Claude PTY sessions running, including sessions unrelated to this Skill. 2. The user or an automation process invokes: ```bash ./scripts/team-cleanup.sh --force --yes ``` 3. `AUTO_YES=true` bypasses the force-shutdown confirmation. 4. `pkill -f "claude.*pty"` searches all processes visible and terminable by the invoking user. 5. Every matching process is sent the default termination signal, rather than only the session associated with the current team. 6. Unrelated sessions may terminate and lose in-progress, ...[truncated 787 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (9)

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.

Content

Scanner excerpt · README.md (reported line 46)May include surrounding context.

md
else
    echo "❌ NOT SET"
    echo "  Fix: export CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1"
    echo "  Or add to ~/.claude/settings.json:"
    echo '  {"env": {"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"}}'
    FAILED=1
fi

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.

Content

Scanner excerpt · SKILL.md (reported line 46)May include surrounding context.

md
else
    echo "❌ NOT SET"
    echo "  Fix: export CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1"
    echo "  Or add to ~/.claude/settings.json:"
    echo '  {"env": {"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"}}'
    FAILED=1
fi

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.

Content

Scanner excerpt · SKILL.md (reported line 139)May include surrounding context.

md
else
    echo "❌ NOT SET"
    echo "  Fix: export CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1"
    echo "  Or add to ~/.claude/settings.json:"
    echo '  {"env": {"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"}}'
    FAILED=1
fi

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.

Content

Scanner excerpt · scripts/validate-setup.sh (reported line 19)May include surrounding context.

sh
else
    echo "❌ NOT SET"
    echo "  Fix: export CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1"
    echo "  Or add to ~/.claude/settings.json:"
    echo '  {"env": {"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"}}'
    FAILED=1
fi

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · scripts/team-cleanup.sh (reported line 26)May include surrounding context.

sh
OPTIONS:
    -h, --help     Show this help message
    -f, --force    Force shutdown (skip graceful steps)
    -y, --yes      Skip confirmation prompts

CLEANUP STEPS:
    1. Signal teammates to complete current tasks

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

This markdown file documents team-monitor.sh as showing active teammates and recent inter-agent messages in real time, which can expose task content or sensitive project context. The description includes no warning that monitored output may contain sensitive data or should be used cautiously in shared terminals/logged sessions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

This markdown file describes shell scripts and hooks for team creation, monitoring, auto-assignment, and cleanup, which could affect running sessions and system state. The document does not include any warning about automation side effects, prerequisites, or the need for review before executing these actions.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

This manifest describes the skill as for "orchestrating Claude Code's native agent teams feature" but provides no explicit invocation phrases, context restrictions, or exclusion conditions. In a manifest file, this kind of broad description can contribute to ambiguous matching or unintended invocation because the scope is not tightly bounded.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

This markdown template includes an API call that sends a bearer token and user profile data, including an uploaded photo, to /api/profile. The surrounding skill description does not warn users that personal data and authentication credentials will be transmitted, which fits the markdown-file criteria for missing warnings about behaviors affecting privacy or user data.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.