Back to skill

Security audit

Agent Skills For Context Engineering

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a legitimate context-engineering skill collection, but it includes optional high-impact infrastructure templates with unsafe command, credential, and filesystem patterns that should be reviewed before use.

Use this skill for context-engineering guidance, but treat the hosted-agent and pipeline scripts as educational starting points rather than production-ready code. Before adapting them, replace shell command strings with argument-based execution, avoid putting tokens in command URLs or logs, validate repository and path identifiers, constrain write/delete targets, escape generated HTML, and manually review generated skills or hooks before enabling them.

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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
skills/hosted-agents/references/infrastructure-patterns.md:40
Finding

Shell Command Injection and GitHub Token Exposure in Hosted-Agent Infrastructure

Content
View full analysis
dict: """Execute a prompt in the sandbox.""" # Update git config for this user os.system(f'git config user.name "{user_identity["name"]}"') os.system(f'git config user.email "{user_identity["email"]}"') ``` The image-building example repeats the unsafe construction: ```python token = get_app_installation_token(repo) sandbox.exec(f"git clone https://x-access-token:{token}@github.com/{repo} /workspace") # Install dependencies sandbox.exec("cd /workspace && npm install") # Run build sandbox.exec("cd /workspace && npm run build") ``` The executable template uses the same command-string design: ```python build_steps: list[str] = [ f"git clone https://x-access-token:{token}@github.com/{repo_url} /workspace", "cd /workspace && npm install", "cd /workspace && npm run build", "cd /workspace && npm run dev &", "sleep 5", "cd /workspace && npm test -- --run || true", ] ``` ```python await sandbox.execute_command( f'git config user.name "{user.name}"' ) await sandbox.execute_command( f'git config user.email "{user.email}"' ) ``` ### Technical Analysis Repository identifiers and user profile fields are interpolated directly into shell command strings. The reference implementation explicitly passes these strings to `os.system`, which always invokes a command shell. Shell metacharacters embedded in `repo_url`, `repo`, `user_identity["name"]`, or `user_identi ...[truncated 2882 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
skills/project-development/scripts/pipeline_template.py:132
Finding

Directory Traversal Enables Writes and Targeted File Deletion Outside Pipeline Directories

Content
View full analysis
Path: """Get the data directory for a batch. Use when: resolving the root directory for a specific batch run. """ return DATA_DIR / batch_id def get_item_dir(batch_id: str, item_id: str) -> Path: """Get the directory for a specific item. Use when: locating stage output files for a single pipeline item. """ return get_batch_dir(batch_id) / item_id def get_output_dir(batch_id: str) -> Path: """Get the output directory for a batch. Use when: writing final rendered outputs (HTML, reports, etc.). """ return OUTPUT_DIR / batch_id ``` Acquired item identifiers are subsequently used to create directories and files: ```python batch_dir = get_batch_dir(batch_id) batch_dir.mkdir(parents=True, exist_ok=True) items = fetch_items_from_source(limit) acquired_dirs: list[Path] = [] for item in items: item_dir = get_item_dir(batch_id, item.id) item_dir.mkdir(exist_ok=True) raw_file = item_dir / "raw.json" if not raw_file.exists(): with open(raw_file, "w") as f: json.dump(asdict(item), f, indent=2) ``` The cleanup stage deletes files below the unvalidated path: ```python batch_dir = get_batch_dir(batch_id) if not batch_dir.exists(): print(f"No data directory for {batch_id}") return 0 stage_outputs: dict[str, list[str]] = { "acquire": ["raw.json"], "prepare": ["prompt.md"], "process": ["response.md"], "parse": ["parsed.json"], } stage_order = ["acquire", "prepare", "process", "parse", "render"] if from_stage: start_idx = stage_order.index(from_stage) stages_to_clean = stage_order[start_idx:] else: stages_to_clean = stage_order files_ ...[truncated 3155 chars]
Remediation
View remediation
str: if not IDENTIFIER_RE.fullmatch(value): raise ValueError(f"Invalid {field}") return value ``` 2. Explicitly reject absolute paths, `.` and `..` components, path separators, null bytes, and control characters. 3. Resolve every destination and verify that it remains under the expected root: ```python def safe_child(root: Path, *parts: str) -> Path: root = root.resolve() candidate = root.joinpath(*parts).resolve() if not candidate.is_relative_to(root): raise ValueError("Path escapes the permitted root") return candidate ``` 4. Apply the containment check to `batch_id`, every externally sourced `item.id`, output locations, and cleanup targets. 5. Before deletion, resolve each file again and verify that it is below the validated batch directory and pipeline data root. 6. Run the pipeline under a dedicated account with write access only to its data and output directories. 7. Add regression tests covering `../`, nested traversal, absolute Unix and Windows paths, symlink escapes, path separators, and malicious item IDs. 8. Consider assigning internal random identifiers to acquired records rather than using source-provided IDs directly as directory names. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
skills/project-development/scripts/pipeline_template.py:554
Finding

Stored HTML Injection Through Unescaped Batch Identifier

Content
View full analysis
str: """Generate HTML output from results. Use when: creating a summary HTML table from parsed pipeline results. """ import html as html_lib rows = "" for r in results: rows += f""" {html_lib.escape(r.get('id', ''))} {html_lib.escape(r.get('summary', '')[:100])}... {r.get('score', 'N/A')} {html_lib.escape(r.get('confidence', ''))} """ return f""" Results - {batch_id} body {{ font-family: system-ui, sans-serif; max-width: 1000px; margin: 0 auto; padding: 20px; }} table {{ width: 100%; border-collapse: collapse; }} th, td {{ text-align: left; padding: 10px; border-bottom: 1px solid #ddd; }} th {{ background: #f5f5f5; }}

Results: {batch_id}

{len(results)} items processed

ID Summary Score Confidence {rows} """ ``` ### Technical Analysis The implementation correctly applies `html.escape` to result IDs, summaries, and confidence values, but inserts the CLI-controlled `batch_id` directly into the HTML `` and `<h1>` contexts. An identifier containing HTML markup can terminate the current element and inject arbitrary tags or script-capable content. Because the generated page is written to disk, the injection is stored and executes when a user opens or serves the report. The severity depen ...[truncated 1951 chars]
Remediation
View remediation
` and `

` elements. 3. Type-enforce and encode every dynamic value, including the score: ```python safe_score = html_lib.escape(str(r.get("score", "N/A")), quote=True) ``` 4. Prefer a template engine with automatic HTML escaping rather than constructing pages with f-strings. 5. Apply the identifier validation and path-containment controls described in the path-traversal finding. 6. When reports are served over HTTP, deploy a restrictive Content Security Policy that disallows inline scripts and unauthorized external resources. 7. Serve generated reports from a separate origin without privileged application cookies or credentials. 8. Add tests using element-breaking payloads in `batch_id` and verify that the resulting page displays them as text rather than markup. ]]>

Vulnerability Patterns
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (395)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description is about agent-system skills for context engineering and multi-agent/production agent workflows. The code chunk is instead focused on preparing literary text for supervised fine-tuning, including text segmentation, prompt/example generation, datum construction for training, and validation of style transfer. These are materially different purposes. There is no meaningful evidence here of context management for agent systems, multi-agent orchestration, or debugging production agents. The mismatch is therefore strong and substantive.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description is about agent-system engineering, context management, and multi-agent architecture support. The supplied code does not build, optimize, debug, or manage agent contexts at all. Instead, it is a standalone content ideation utility for generating writing/post ideas from stored content, bookmarks, and ideas. This is a materially different primary purpose and accesses a different class of resources (content/knowledge JSONL files rather than agent-system configuration or runtime context data). Therefore the description does not accurately represent the code's behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

The declared description frames the skill as focused on agent-system engineering: context management, multi-agent architectures, and production agent debugging/optimization. The supplied code instead implements a content-production utility that expands an idea into a draft using local idea, bookmark, and post repositories. Its primary purpose is content writing support, not agent architecture or context-engineering for production agents. While it does perform a kind of context gathering, that context is for drafting written content, which is materially different from the declared domain. Therefore this is a clear description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents this skill as a general toolkit for context engineering and multi-agent/production agent systems. The supplied code chunk instead implements a specific 'stale contacts' analysis utility for a digital-brain/contact-management workflow. Its primary purpose is unrelated to context management or multi-agent system construction/debugging. It accesses contact records from a local network dataset and produces an outreach report, which is a materially different capability from the declared purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description presents this as a general-purpose collection of agent skills for context engineering and multi-agent/production agent systems. The supplied code instead implements a narrowly focused weekly review generator for a 'Digital Brain' dataset. It loads local JSONL files from content, network, and operations directories, counts weekly posts, ideas, and interactions, reads latest audience metrics, and formats a review document. This is materially different from the stated purpose and involves specific data-access and reporting behavior not represented in the description. Therefore, this is a clear description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description says this skill collection is for context engineering, multi-agent architectures, and production agent systems. The supplied code does not implement or expose those functions; it is only an installation script for a different-seeming skill named 'digital-brain'. It interactively chooses an install path, creates directories, may overwrite existing content, copies files, and removes the installer from the target. The post-install guidance references identity, brand, contacts, and content ideas, reinforcing that the underlying skill is about personal knowledge/voice management rather than agent-system engineering. This is a material description-behavior mismatch, not merely a supporting implementation detail.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
89% confidence
Finding

The declared description presents a broad agent-systems/context-engineering skill collection, but this code chunk specifically demonstrates capturing reasoning traces from a remote model API and printing them. Its primary purpose is trace capture/inspection for one model interaction, not context engineering, multi-agent orchestration, or production agent-system optimization. It also accesses external resources via an API key and network endpoint, which are not reflected in the declared permissions. This is a materially different behavior from the stated purpose, so it should be flagged as a mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description presents a broad skill collection for context engineering, multi-agent architectures, and production agent systems. The supplied code chunk instead behaves as a narrow example/demo for tool-usage tracing in an interleaved-thinking framework. Its primary purpose is to run a weather comparison task through a remote model, execute mock tools, and inspect reasoning traces. That is materially different from the declared purpose. The external API usage and trace-capture behavior are also undeclared in the description. While trace inspection could loosely relate to agent debugging, this code is not actually implementing context management or multi-agent architecture features, so the mismatch is substantive.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
86% confidence
Finding

The description presents a broad reusable collection of agent skills centered on context engineering and production agent systems. The supplied code chunk is instead a concrete example program that runs a full optimization loop for a research assistant, including tool execution, artifact saving, local file I/O, note persistence, and skill generation. While topically related to context engineering and agent optimization/debugging, its primary purpose is materially narrower and operational: demonstrating and executing an optimization workflow. It also performs capabilities not implied by the description, such as writing files/artifacts and generating a new skill through external API-backed components. Therefore the code does not accurately match the declared description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The declared description is broad and framed as a collection of agent skills for context engineering and multi-agent/production agent systems. The supplied code chunk instead provides a narrowly focused trace-capture wrapper around a specific model API (MiniMax M2.1 via the Anthropic SDK). Its primary behavior is collecting internal thinking traces, tool interactions, token usage, and formatting/displaying those traces. That is more specialized than the declared purpose and introduces undeclared external API interaction and reasoning-trace capture capabilities. While trace analysis could support debugging agent systems, the code does not match the description of a comprehensive context-engineering skill collection; it is a concrete instrumentation utility with materially different primary behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description presents this as a broad collection of agent skills for context engineering and multi-agent/production agent systems. The supplied code instead exposes a narrowly focused command-line tool for reasoning trace capture, analysis, prompt optimization, and generated skill creation around a specific 'Reasoning Trace Optimizer'. While optimization/debugging of agent behavior is loosely adjacent to the declared domain, the primary purpose and concrete capabilities are materially different and much more specific than a general skill collection for context engineering or multi-agent architectures.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The description is broad and centered on a general collection of agent-system skills for context engineering and multi-agent/production systems. The code chunk, however, is narrowly focused on one concrete function: optimizing prompts by capturing reasoning traces, analyzing them, generating improved prompts, and rerunning iteratively. It also saves artifacts to disk and relies on external API-driven components, neither of which is reflected in the declared purpose. This is more than a supporting implementation detail; the primary behavior is materially narrower and different from the declared description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
87% confidence
Finding

The declared description suggests this skill/package is a broad collection of reusable Agent Skills for context engineering and multi-agent/production agent systems. The supplied code chunk instead performs a narrower, materially different function: it programmatically generates a new skill from optimization-loop outputs using an LLM API, then saves the resulting SKILL.md and related reference files locally. That is not simply a 'collection' of skills for context management; it is a skill-generation tool tied to reasoning trace optimization artifacts. Additionally, the code uses undeclared external network access and filesystem output, which are meaningful capabilities absent from the declaration. This is therefore a description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description presents a broad, production-oriented collection of agent skills for context engineering and multi-agent systems. The actual code chunk does not implement such capabilities; it is merely an init.py file with a docstring labeling tests for a Reasoning Trace Optimizer. This is a materially different and much narrower purpose, so the description does not accurately represent the supplied code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description promises agent skills for designing and operating agent systems, especially around context management and multi-agent setups. The supplied code does not implement any such skill behavior; it only configures ESLint for an example project by selecting recommended rule sets, ignore paths, and specific TypeScript lint rules. That is a materially different primary purpose, so this is a clear description-to-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description focuses on agent-system engineering, context management, and multi-agent/production agent skills. The supplied code chunk instead implements a basic evaluation example for scoring an answer using an EvaluatorAgent with criteria like accuracy, clarity, and completeness. That is a materially different primary purpose from context engineering or debugging agent systems. It also validates configuration for API access, implying external model usage not reflected in the declared purpose. This is not just a supporting detail; the core functionality is content evaluation/judging, so the description does not accurately represent the code.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description emphasizes context engineering, multi-agent architectures, and production agent systems for effective context management. The supplied code instead demonstrates an LLM evaluation pipeline: generating rubrics, scoring a response on criteria, and comparing two responses. That is a materially different primary purpose from context management or multi-agent system engineering. There is no evident behavior here related to context engineering or debugging agent context flows; the code is centered on assessment/judging functionality. Therefore, the description does not accurately represent this code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description says this skill collection is for context engineering, multi-agent architectures, and production agent systems requiring effective context management. The supplied code instead demonstrates rubric generation using an EvaluatorAgent, specifically creating scoring levels, guidelines, and edge-case handling for an evaluation criterion. That is a materially different primary purpose from context management or multi-agent system engineering. There are no notable undeclared sensitive permissions in this snippet, but the behavior is clearly outside the declared scope, so this is a mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description centers on context engineering, multi-agent architectures, and production agent-system support. The supplied code chunk instead demonstrates an evaluation workflow where an EvaluatorAgent compares two candidate responses and selects a winner based on specified criteria. This is a materially different primary purpose from context management or multi-agent orchestration/debugging. There is no evidence in this chunk of context engineering, multi-agent coordination, or production agent system management; instead it provides LLM-as-judge style assessment functionality. Therefore the description does not accurately represent this code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description emphasizes context engineering, multi-agent architectures, and production agent systems for context management. The supplied code instead provides an evaluation agent focused on judging AI-generated content via scoring, comparison, rubric generation, and chat-based evaluation. This is a materially different primary purpose rather than a supporting implementation detail. The code also uses an OpenAI model for evaluator chat behavior, which is not reflected in the declared description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description presents a broad skill set focused on context engineering, multi-agent architectures, and production agent systems. The provided code, however, is a minimal TypeScript barrel file that simply re-exports an EvaluatorAgent and its configuration type. Based on this chunk alone, the observable behavior is centered on exposing evaluator/judge agent functionality, not context management or a comprehensive agent-systems toolkit. This is a materially different primary purpose, so it should be flagged as a mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description emphasizes context engineering, multi-agent architectures, and production agent systems. However, the supplied code chunk is an entrypoint for a package focused on evaluation: it exports tools under './tools/evaluation', types such as DirectScore, PairwiseCompare, and GenerateRubric, and related agents/config. That is a materially different primary purpose from the declared description. No sensitive permissions or resource access are evident in this snippet, but the functional focus is clearly mismatched.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description presents this skill as a general-purpose collection for context engineering, multi-agent architectures, and production agent systems. The supplied code instead performs a narrow, concrete function: rubric-based evaluation of an LLM response using an OpenAI model, including evidence extraction, justifications, and weighted scoring. This is a materially different primary purpose from context management or agent-system building/debugging. The code also uses an external model API, which is not reflected in the declared purpose, though no permissions were declared. Overall, this is a clear description-to-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The declared description is broad but specifically centered on context engineering, multi-agent architectures, and production agent systems. This code chunk instead implements a narrowly focused 'generate rubric' evaluation tool for LLM-as-judge workflows. Its primary behavior is creating scoring rubrics via an OpenAI model call, not managing context, orchestrating agents, or debugging production agent systems. The external model usage is also undeclared in the supplied permissions. This is a material purpose mismatch rather than a mere implementation detail.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description emphasizes context engineering, multi-agent architectures, and production agent systems. However, the supplied code does not expose context-management or multi-agent system capabilities; instead it re-exports tools for evaluation workflows, specifically scoring, pairwise comparison, and rubric generation. This indicates a materially different primary purpose from what was declared.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.dynamic_code_execution, suspicious.prompt_injection_instructions

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
examples/interleaved-thinking/examples/03_full_optimization.py:995

Prompt-injection style instruction pattern detected.

Warn
Code
suspicious.prompt_injection_instructions
Location
docs/compression.md:243

Prompt-injection style instruction pattern detected.

Warn
Code
suspicious.prompt_injection_instructions
Location
docs/gemini_research.md:8

Prompt-injection style instruction pattern detected.

Warn
Code
suspicious.prompt_injection_instructions
Location
examples/llm-as-judge-skills/README.md:169