Back to skill

Security audit

Identity Persistence Layer

Security checks for vulnerabilities and agentic risk

Overview

This skill has a coherent identity-snapshot purpose, but it reads sensitive agent files and a local Google token, then sends raw workspace content to Gemini without clear disclosure or consent controls.

Review carefully before installing or running. Use this only in a workspace where you are comfortable sending identity, memory, user, tool, and heartbeat file contents to Google's Gemini API and storing derived identity snapshots locally. Prefer a version that lets you choose source files, preview/redact content, supply the API key explicitly, and delete or protect generated snapshots.

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

T05 · Unauthorized Access and Privilege Escalation

Error
Location
identity_manager.py:35
Finding
Undisclosed Transmission of Sensitive Workspace Files to Gemini<![CDATA[ ## Vulnerability Details **File Location**: `identity_manager.py`, lines 35-43, 68-86, 88-95, 111-175, and 411-418 **Vulnerability Type**: Excessive collection and external disclosure of sensitive workspace information **Risk Level**: High ### Vulnerable Code Source files collected by the Skill: ```python SOURCE_FILES = { "soul": WORKSPACE / "SOUL.md", "memory": WORKSPACE / "MEMORY.md", "user": WORKSPACE / "USER.md", "identity_md": WORKSPACE / "IDENTITY.md", "tools": WORKSPACE / "TOOLS.md", "heartbeat": WORKSPACE / "HEARTBEAT.md", } ``` Network transmission to the Gemini API: ```python def call_gemini(prompt, api_key, max_tokens=8000): """Call Gemini API and return text response.""" url = f"{GEMINI_URL}?key={api_key}" payload = { "contents": [{"parts": [{"text": prompt}]}], "generationConfig": { "maxOutputTokens": max_tokens, "temperature": 0.2, # Low temp for consistent extraction }, } req = urllib.request.Request( url, data=json.dumps(payload).encode(), headers={"Content-Type": "application/json"}, method="POST", ) try: with urllib.request.urlopen(req, timeout=60) as resp: data = json.loads(resp.read()) return data["candidates"][0]["content"]["parts"][0]["text"] ``` Unfiltered file reading: ```python def read_sources(): """Read all source markdown files.""" sources = {} for name, path in SOURCE_FILES.items(): if path.exists(): text = path.read_text(encoding="utf-8", errors="replace") # Cap each file at 15KB to stay within context sources[name] = text[:15000] return sources ``` Raw source aggregation and submission: ```python def synthesize_identity(sources, api_key): """Use Gemini to extract structured identity from markdown sources.""" combined = "\n\n".join( f"=== {name.upper()} ===\n{text}" for name, text ...[truncated 5625 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. **Reduce the default source scope** - Restrict default processing to the files explicitly documented as requirements, such as `MEMORY.md` and `SOUL.md`. - Require explicit command-line options for additional sources, for example: ```bash python3 identity_manager.py --source MEMORY.md --source SOUL.md ``` 2. **Require informed approval** - Before the first external request, display the exact files selected, the number of bytes to be sent, and the destination service. - Require affirmative confirmation unless a specific noninteractive consent flag has been supplied. 3. **Add sensitivity filtering** - Detect and redact API keys, access tokens, passwords, private keys, authentication headers, email addresses, and other sensitive patterns before constructing the prompt. - Apply structured allowlisting instead of relying solely on pattern-based redaction. 4. **Minimize transmitted content** - Parse source files locally and transmit only fields required for identity extraction. - Exclude tool configuration, heartbeat data, and unrelated operational instructions. - Avoid sending entire raw documents when selected excerpts or locally generated summaries are sufficient. 5. **Provide a transmission preview** - Add a `--dry-run` or `--preview-prompt` mode that shows what categories and files would be submitted. - The preview should redact detected secrets while still enabling the user to verify scope. 6. **Make external processing configurable** - Support a local-only extraction mode where feasible. - Allow users to configure the model provider and data-handling policy explicitly rather than silently relying on the default endpoint. 7. **Update documentation** - Clearly identify every file read by each execution mode. - State that selected source content is sent to Google's Gemini API. - Describe retention and privacy implications and advise users not to store credentia ...[truncated 300 chars]
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The skill requires a Gemini API key for identity extraction but does not warn that MEMORY.md and/or SOUL.md contents may be transmitted to an external API provider. Because these files can contain sensitive memories, relationships, beliefs, or other private agent data, omission of this disclosure creates a meaningful privacy and data-handling risk.

Context-Inappropriate Capability

Medium
Confidence
93% confidence
Finding
The code directly reads a Google API token from a local auth-profiles file and uses it for outbound API calls. Even if intended for legitimate operation, this grants credential-access capability to the script and couples sensitive secret retrieval to functionality that could instead accept a scoped token via environment variable or explicit user-provided configuration, increasing the blast radius if the script or workspace is modified.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The script aggregates potentially sensitive local files such as SOUL.md, MEMORY.md, USER.md, IDENTITY.md, TOOLS.md, and HEARTBEAT.md, then sends their contents to Google's Gemini API. There is no explicit consent flow, redaction step, classification check, or warning about external transmission, so private user data, agent state, and operational details may be exposed to a third party.

Missing User Warnings

Low
Confidence
94% confidence
Finding
The skill documentation describes generated files such as current_identity.json, snapshots/, and diffs/, but it does not clearly warn users that running the tool will persist potentially sensitive identity and memory-derived data to disk. This can lead to unintended local retention of agent-private information, especially in shared workspaces, backups, or synced directories.

Static analysis

No suspicious patterns detected.