Back to skill

Security audit

Ai Integration

Security checks for vulnerabilities and agentic risk

Overview

This skill is instructional and coherent, but some examples show powerful AI-agent patterns without enough safeguards for local files, conversation history, and stored memory.

Install only if you will treat the snippets as starting points, not production-ready code. Add workspace-bound file access, explicit user approval for sensitive reads, redaction before external model calls, per-user or per-tenant memory isolation, retention/deletion controls, and prompt-injection defenses around retrieved RAG content.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (3)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
SKILL.md:165
Finding

Unrestricted File-Reading Tool Can Expose Local Data to an External LLM

Content
View full analysis
{ const messages: Anthropic.MessageParam[] = [{ role: "user", content: userMessage }]; while (true) { const response = await client.messages.create({ model: "claude-sonnet-4-6", max_tokens: 4096, tools, tool_choice: { type: "auto" }, messages, }); if (response.stop_reason === "end_turn") { return response.content.filter((b) => b.type === "text").map((b) => b.text).join(""); } const toolUses = response.content.filter((b) => b.type === "tool_use"); const toolResults = await Promise.all( toolUses.map(async (tu) => ({ type: "tool_result" as const, tool_use_id: (tu as Anthropic.ToolUseBlock).id, content: await executeTool((tu as Anthropic.ToolUseBlock).name, (tu as Anthropic.ToolUseBlock).input), })) ); messages.push({ role: "assistant", content: response.content }); messages.push({ role: "user", content: toolResults }); } } ``` ### Technical Analysis The example exposes a `read_file` tool whose only input constraint is an arbitrary string path. It does not demonstrate workspace confinement, canonical-path validation, a path allowlist, a sensitive-file denylist, symlink protection, per-call authorization, or user confirmation. The model selects tools automatically, and the resulting file contents are appended to the ...[truncated 1854 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:81
Finding

Conversation History Is Sent to an External Model Without Data-Minimization Controls

Content
View full analysis
list[dict]: """Compress old turns into a summary to reclaim context budget.""" if len(messages) <= 4: return messages history = "\n".join(f"{m['role']}: {m['content']}" for m in messages[:-2]) summary = client.messages.create( model="claude-haiku-4-5", max_tokens=512, messages=[{"role": "user", "content": f"Summarize concisely:\n{history}"}], ).content[0].text return [{"role": "user", "content": f"[Prior context]\n{summary}"}] + messages[-2:] ``` ### Technical Analysis The function concatenates nearly the entire prior conversation and submits it to an external model for summarization. No data classification, secret scanning, personal-data filtering, user consent, tenant-boundary enforcement, provider-retention control, or selection of only task-relevant turns is demonstrated. External model calls are expected for the Skill's declared AI-integration functionality. The risk arises because the example transmits all older content rather than the minimum information required for summarization. Conversation histories commonly contain credentials, proprietary code, personal information, internal URLs, customer data, or other material whose transmission may be restricted. ### Attack Path 1. Sensitive information is included in an earlier conversation message, tool result, or generated response. 2. The conversation grows beyond four messages. 3. `summarize_history` concatenates all messages except the most recent two. 4. The entire concatenated history is placed into an API request. 5. The external LLM provider receives and processes the sensitive content. 6. Depending on provider configuration and organizational policy, the content may enter logs, monitoring systems, re ...[truncated 662 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:396
Finding

RAG Memory Content Is Externally Transmitted and Treated as Trusted System Instructions

Content
View full analysis
str: hits = qdrant.search(collection_name=context_collection, query_vector=get_embedding(query), limit=5) context = "\n".join(h.payload["text"] for h in hits) response = claude.messages.create( model="claude-sonnet-4-6", max_tokens=1024, system=f"Answer using this context:\n{context}", messages=[{"role": "user", "content": query}], ) return response.content[0].text ``` ### Technical Analysis The example retrieves arbitrary payload text from a memory collection, concatenates it without validation, and sends it to an external LLM. It does not demonstrate record-level authorization, tenant filtering, sensitivity classification, provenance checking, or redaction. Retrieved text is also interpolated directly into the `system` prompt. This assigns untrusted stored content a privileged instruction position. If an attacker can influence documents or memory records, malicious instructions can be retrieved and interpreted as part of the system message. The use of in-memory Qdrant in this example limits persistence, but it does not remove the disclosure or indirect prompt-injection risk during the running process. ### Attack Path 1. An attacker or untrusted ingestion source introduces a memory record containing sensitive data or adversarial instructions. 2. A later query produces an embedding sufficiently similar to retrieve that record. 3. `rag_query` extracts the record's `payload["text"]` without authorization or validation. 4. The text is concatenated into `context`. 5. The context is inserted direct ...[truncated 1000 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (2)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill recommends persistent cross-session agent memory in SQLite without any warning about retention, sensitivity, access control, or lifecycle management. In real deployments, developers may store user prompts, secrets, or personal data indefinitely, creating privacy, compliance, and insider-access risks even if the code itself is only illustrative.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The RAG example retrieves stored context and injects it directly into an external LLM request without warning that retrieved memory may contain sensitive, cross-user, or regulated information. This can lead to unintended disclosure to third-party providers, data boundary violations, and prompt-injection amplification if untrusted stored content is sent back to the model unchecked.

Content

No source excerpt is available for this finding.