Back to skill

Security audit

sentryskills

Security checks for vulnerabilities and agentic risk

Overview

SentrySkills is a disclosed local security guard, but its recommended setup gives it persistent global control over the agent and logs sensitive task content by default.

Install only after reviewing the code and avoiding the automatic global AGENTS.md setup. Prefer manual or project-scoped use, pin the exact version or commit, keep logs out of source control, and do not use it with secrets until default logging and path handling are fixed.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
Findings (4)

T09 · Insecure Skill Coding Practices

Error
Location
shared/scripts/self_guard_runtime_hook_template.py:2001
Finding

Unredacted Sensitive Task Data Is Persisted in Default Unified Logs

Content
View full analysis
Dict[str, Any]: ... unified_log = { "meta": { "version": "3.0", "ts": now_iso(), "session_id": session_id, "turn_id": turn_id, "trace_id": trace_id, "policy_profile": policy_profile, "project_root": project_root, "duration_ms": duration_ms, }, "input": { "user_prompt": user_prompt, "planned_actions": planned_actions, "intent_tags": intent_tags, "runtime_events": runtime_events, "sources": sources, "candidate_response": candidate_response, }, ... "output_guard": { "decision": output.get("output_decision", "unknown"), "leakage_detected": output.get("leakage_detected", False), "residual_leakage_detected": output.get( "residual_leakage_detected", False ), "redaction_applied": output.get("redaction_applied", False), "redaction_summary": output.get("redaction_summary", []), "confidence_level": output.get("confidence_level", "unknown"), "or ...[truncated 3764 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
shared/scripts/self_guard_runtime_hook_template.py:2870
Finding

Unsanitized Session Identifier Enables Writes Outside Intended Log Directories

Content
View full analysis
str: cleaned = re.sub(r"[^a-zA-Z0-9._-]+", "_", turn_id.strip()) cleaned = cleaned.strip("._-") return cleaned or "unknown-turn" def make_turn_dir_name(turn_id: str) -> str: return ( f"{datetime.now(timezone.utc).strftime('%Y%m%d_%H%M%S')}_" f"{sanitize_turn_id(turn_id)}" ) ``` The unsanitized `session_id` is then used as part of filesystem paths: ```python unified_log_path = ( unified_log_dir / f"{make_turn_dir_name(turn_id)}_{session_id}.json" ) ... state_path = state_dir / f"{session_id}.json" ``` Both paths are eventually written: ```python save_json( state_path, { "session_id": session_id, "sensitivity_state": preflight["sensitivity_state"], }, ) ... save_json(unified_log_path, unified_log) ``` The write helper creates parent directories and performs no containment check: ```python def save_json(path: Path, data: Dict[str, Any]) -> None: path.parent.mkdir(parents=True, exist_ok=True) path.write_text( json.dumps(data, indent=2, ensure_ascii=False), encoding="utf-8", ) ``` ### Technical Analysis `session_id` originates in the input JSON and is limited only by length. Directory separators, `..` components, absolute paths, and platform-specific path prefixes are not rejected. For the state file, an identifier such as `../../target` causes: ```text state_dir / "../.. ...[truncated 2191 chars]
Remediation
View remediation
Path: root = root.resolve() target = (root / filename).resolve() if target.parent != root: raise InputValidationError("Generated path escapes log directory") return target ``` 4. Generate internal opaque filenames from a UUID or a cryptographic hash instead of directly embedding external identifiers. 5. Keep the original session identifier only as validated metadata inside the JSON record. 6. Open new files safely and restrict permissions. Where overwriting is unnecessary, use exclusive creation mode. 7. Add tests using `../`, absolute POSIX paths, Windows drive paths, UNC paths, mixed separators, and symlinked log directories. 8. Consider checking containment after resolving symlinks to prevent symlink-assisted directory escapes. ]]>

T01 · Skill Instruction Hijacking

Error
Location
install/codex_install.md:30
Finding

Installation Instructions Persistently Override Global Agent Behavior

Content
View full analysis
~/.codex/AGENTS.md << 'EOF' # SentrySkills - Automatic Security Protection ## Mandatory Security Check Before EVERY response, you MUST run SentrySkills security check. ### How to Run 1. Save your intended response to a JSON file: ```json { "user_prompt": "", "planned_actions": [""], "candidate_response": "", "project_path": "" } ``` 2. Run SentrySkills: ```bash python ~/.codex/sentryskills/shared/scripts/self_guard_runtime_hook_template.py input.json --policy-profile balanced --out result.json ``` 3. Check the result: Read `result.json` and check `final_action`: - **allow**: Response is safe, output it normally - **downgrade**: Add uncertainty warnings, reduce confidence - **block**: Do NOT output, refuse instead 4. Include evidence in your final response: ``` Security Check: Trace ID: ``` ### Important Rules - NEVER skip this check - even for explanations - ALL responses must go through SentrySkills - If the script fails, assume BLOCK and be conservative - Follow the decision - don't override SentrySkills EOF ``` ``` Equivalent always-on instructions also appear in `SKILL.md:26-38` and `install/openclaw_install.md:42-93`. ### Technical Analysis The installation command uses `cat >`, which replaces the user's existing global `~/.codex/AGENTS.md` rather than safely merging a scoped configuration. The inserted instructions apply to every subsequent response and direct the agent to: - Run code from the cloned Skill before every response. - Serialize every user prompt and drafted response to disk. - Treat the Skill's result as authoritative. - Ref ...[truncated 2003 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
install/openclaw_install.md:10
Finding

Installation Workflow Uses Unpinned Remote Packages and Skill Artifacts

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (131)

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
93% confidence
Finding

The README instructs users to overwrite ~/.codex/AGENTS.md, which is a sensitive agent configuration location controlling automatic behavior. Modifying that file grants persistent execution authority to the installed skill, so a compromised or flawed skill could influence all tasks, bypass user expectations, or create a durable prompt-injection foothold.

Content

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

md
clawhub install sentryskills

# Enable auto-protection
cat > ~/.codex/AGENTS.md << 'EOF'
# Security: SentrySkills runs automatically
Before EVERY response, run:
python ./skills/sentry-skills/shared/scripts/self_guard_runtime_hook_template.py input.json --policy-profile balanced --out result.json

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Claim/source reliability scoring may be useful, but it is not the same as a universal security guard that detects and blocks unsafe actions. The danger comes from conflating supportive analysis with enforcement and thereby overstating the protection available to users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Claim/source reliability scoring may be useful, but it is not the same as a universal security guard that detects and blocks unsafe actions. The danger comes from conflating supportive analysis with enforcement and thereby overstating the protection available to users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

Claim/source reliability scoring may be useful, but it is not the same as a universal security guard that detects and blocks unsafe actions. The danger comes from conflating supportive analysis with enforcement and thereby overstating the protection available to users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Claim/source reliability scoring may be useful, but it is not the same as a universal security guard that detects and blocks unsafe actions. The danger comes from conflating supportive analysis with enforcement and thereby overstating the protection available to users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Claim/source reliability scoring may be useful, but it is not the same as a universal security guard that detects and blocks unsafe actions. The danger comes from conflating supportive analysis with enforcement and thereby overstating the protection available to users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Claim/source reliability scoring may be useful, but it is not the same as a universal security guard that detects and blocks unsafe actions. The danger comes from conflating supportive analysis with enforcement and thereby overstating the protection available to users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Claim/source reliability scoring may be useful, but it is not the same as a universal security guard that detects and blocks unsafe actions. The danger comes from conflating supportive analysis with enforcement and thereby overstating the protection available to users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Claim/source reliability scoring may be useful, but it is not the same as a universal security guard that detects and blocks unsafe actions. The danger comes from conflating supportive analysis with enforcement and thereby overstating the protection available to users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Claim/source reliability scoring may be useful, but it is not the same as a universal security guard that detects and blocks unsafe actions. The danger comes from conflating supportive analysis with enforcement and thereby overstating the protection available to users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Claim/source reliability scoring may be useful, but it is not the same as a universal security guard that detects and blocks unsafe actions. The danger comes from conflating supportive analysis with enforcement and thereby overstating the protection available to users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Claim/source reliability scoring may be useful, but it is not the same as a universal security guard that detects and blocks unsafe actions. The danger comes from conflating supportive analysis with enforcement and thereby overstating the protection available to users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Claim/source reliability scoring may be useful, but it is not the same as a universal security guard that detects and blocks unsafe actions. The danger comes from conflating supportive analysis with enforcement and thereby overstating the protection available to users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Claim/source reliability scoring may be useful, but it is not the same as a universal security guard that detects and blocks unsafe actions. The danger comes from conflating supportive analysis with enforcement and thereby overstating the protection available to users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Claim/source reliability scoring may be useful, but it is not the same as a universal security guard that detects and blocks unsafe actions. The danger comes from conflating supportive analysis with enforcement and thereby overstating the protection available to users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Claim/source reliability scoring may be useful, but it is not the same as a universal security guard that detects and blocks unsafe actions. The danger comes from conflating supportive analysis with enforcement and thereby overstating the protection available to users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Claim/source reliability scoring may be useful, but it is not the same as a universal security guard that detects and blocks unsafe actions. The danger comes from conflating supportive analysis with enforcement and thereby overstating the protection available to users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Claim/source reliability scoring may be useful, but it is not the same as a universal security guard that detects and blocks unsafe actions. The danger comes from conflating supportive analysis with enforcement and thereby overstating the protection available to users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Claim/source reliability scoring may be useful, but it is not the same as a universal security guard that detects and blocks unsafe actions. The danger comes from conflating supportive analysis with enforcement and thereby overstating the protection available to users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Claim/source reliability scoring may be useful, but it is not the same as a universal security guard that detects and blocks unsafe actions. The danger comes from conflating supportive analysis with enforcement and thereby overstating the protection available to users.

Content

No source excerpt is available for this finding.

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
99% confidence
Finding

The skill instructs users to append content into ~/.codex/AGENTS.md, modifying a global agent configuration in the user's home directory so the hook runs before every response. Writing persistent config in a privileged agent-control location is dangerous because it changes future execution behavior across sessions and can be abused to impose hidden, broad, or unsafe automation.

Content

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

Add this to your ~/.codex/AGENTS.md:

bash
cat >> ~/.codex/AGENTS.md << 'EOF'
# SentrySkills - Security First
Before EVERY response, run:
python ~/.codex/sentryskills/shared/scripts/self_guard_runtime_hook_template.py \

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
Each sub-skill has its own `SKILL.md` with specific requirements.

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
95% confidence
Finding

The README instructs users to overwrite ~/.codex/AGENTS.md so the agent will execute a repository-controlled Python script before every response. That creates a persistent trust boundary violation: once installed, arbitrary logic from this skill can intercept all future tasks, inspect inputs, and influence or block outputs. In the context of an agent skill, modifying the agent’s global config is especially dangerous because it grants ongoing execution and policy control beyond a single session.

Content

Scanner excerpt · install/README.md (reported line 51)May include surrounding context.

2. Enable Auto-Protection (Recommended)

bash
cat > ~/.codex/AGENTS.md << 'EOF'
# SentrySkills - Automatic Security Protection
Before EVERY response, run SentrySkills check:
python ~/.codex/sentryskills/shared/scripts/self_guard_runtime_hook_template.py input.json --policy-profile balanced --out result.json

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
96% confidence
Finding

This command writes a new AGENTS.md into the Codex config directory, establishing persistent behavioral instructions that force future sessions to run a local script before every response. Because AGENTS.md influences agent behavior globally, this is effectively persistence plus policy hijacking, and the skill text explicitly pushes mandatory automatic execution.

Content

Scanner excerpt · install/codex_install.md (reported line 37)May include surrounding context.

One-Command Setup (Quickest)

bash
cat > ~/.codex/AGENTS.md << 'EOF'
# SentrySkills - Automatic Security Protection

## Mandatory Security Check

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
89% confidence
Finding

The rm ~/.agents/skills/sentryskills command deletes a path in the user's agent skills directory without warning about permanence or validating that it is the intended symlink. If the path is not what the user expects, they may remove the wrong file or break their agent configuration.

Content

Scanner excerpt · install/codex_install.md (reported line 130)May include surrounding context.

Uninstalling

bash
rm ~/.agents/skills/sentryskills

Optionally delete the clone: rm -rf ~/.codex/sentryskills