Back to skill

Security audit

Context Gatekeeper

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent conversation-compaction skill, but it needs review because it stores chats on disk, can run continuously, and reuses prior conversation text without privacy or prompt-injection controls.

Install only if you are comfortable with conversation text being written to local files and reused in later prompts. Avoid using it in chats containing secrets, regulated data, credentials, or sensitive business details unless you add redaction, retention limits, restrictive file permissions, and a clear way to disable the monitor. Prefer manual, user-approved runs over the documented always-on workflow.

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

T01 · Skill Instruction Hijacking

Warning
Location
scripts/context_gatekeeper.py:41
Finding

Untrusted Conversation Content Is Reintroduced as Active Model Context

Content
View full analysis
list[str]: sentences = [] for entry in entries: sentences.extend(split_sentences(entry["text"])) if not sentences: return [] if limit <= 0: return [] if len(sentences) <= limit: return sentences half = limit // 2 first_chunk = sentences[:half] last_chunk = sentences[-(limit - half) :] return first_chunk + last_chunk ``` ```python def format_recent(entries: list[dict], count: int) -> list[str]: recent = entries[-count:] if count > 0 else [] formatted = [f"{entry['role']}: {entry['text']}" for entry in recent] return formatted def build_markdown(summary: list[str], pendings: list[str], recent: list[str]) -> str: catalyst = datetime.now(timezone.utc).isoformat(timespec="seconds") sections = ["# Context Gatekeeper", f"_Gerado: {catalyst}_", ""] if summary: sections.append("## Resumo compacto") sections.extend(f"- {sent}" for sent in summary) sections.append("") else: sections.append("## Resumo compacto") sections.append("- Sem conteúdo suficiente para resumir.") sections.append("") if pendings: sections.append("## Pendências e próximos passos") sections.extend(f"- {task}" for task in pendings) sections.append("") else: sections.append("## Pendências e próximos passos") sections.append("- Nenhuma pendência identificada no histórico recente.") sections.append("") if recent: sections.append("## Últimos turnos") sections.extend(f"- {line}" for line in recent) else: sections.append("## Últi ...[truncated 3296 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
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (15)

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The README documents a persistent background monitor and shell process management for a skill whose stated purpose is conversation summarization. That expands the skill's privilege and persistence footprint beyond what is necessary, creating opportunities for unintended long-running data collection, process abuse, or stealthy behavior if the monitor or launch script is modified or misused.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The workflow instructs operators to append every incoming and outgoing message to a history file and retain token/accounting details, but provides no privacy filtering, retention limits, or handling guidance for sensitive content. In a conversational system, this can capture credentials, personal data, proprietary information, or security-sensitive prompts and store them in plaintext, increasing exposure through local compromise, logs, backups, or secondary tooling.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill clearly requires file reads, file writes, and shell execution via the documented Python command, but the manifest does not declare any tool scope or permission boundaries. That omission makes the skill easier to invoke with broader-than-necessary capabilities and reduces reviewability of what the skill is allowed to access or modify.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The description says to trigger the skill whenever a thread is bloated or the next prompt should be lean, which is broad enough to encourage frequent or automatic invocation across many conversations. In this skill's context, broad triggering is more dangerous because each run logs and reuses prior conversation content, increasing unnecessary data collection and propagation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The instructions direct the agent to create, replace, and maintain history and summary files but do not warn about overwriting data, storing sensitive content, or retaining private conversations on disk. This can lead to accidental data loss and privacy exposure, especially because the summary file becomes a reusable context source for future prompts.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill instructs persistent logging of every user and assistant exchange into a history file for later reuse. This creates a direct data retention risk: secrets, personal data, and sensitive operational details may be stored on disk and then resurfaced in later prompts or outputs beyond their original purpose.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The workflow explicitly tells the agent to inject summarized prior conversation and pending items before answering, which increases the chance that sensitive information will be carried forward into unrelated prompts, model calls, or responses. In a context-compaction skill, this is especially risky because propagation is the core behavior, so any secret captured once may be repeatedly reintroduced.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The only natural-language description in the file is written in Portuguese, which indicates a fixed language choice without any visible opt-in or explanation that the skill is region-specific. The policy requires flagging language or locale constraints when the skill does not offer user choice or clearly justify the limitation.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/auto_monitor.py (reported line 29)May include surrounding context.

python
args = [sys.executable, SCRIPT_PATH, "--history", HISTORY_PATH, "--summary", SUMMARY_PATH]
    log(f"Atualizando resumo ({' '.join(args)})")
    try:
        result = subprocess.run(args, check=True, capture_output=True, text=True)
    except subprocess.CalledProcessError as exc:
        log(f"Erro ao gerar resumo: {exc} | stdout={exc.stdout.strip()} stderr={exc.stderr.strip()}")
    else:

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Natural-language strings throughout the file, including the module description, CLI help text, and generated markdown sections, are all fixed in Portuguese. This creates a language/locale policy issue because users are not given any opt-in or configuration to select another language, and the file does not document a region-specific justification.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The script copies recent conversation turns verbatim into the generated markdown, which can persist secrets, personal data, or sensitive operational content into a secondary artifact. In this skill's context, the whole purpose is to condense chat history for later model use, so reproducing raw turns increases the chance that unnecessary sensitive data is retained, surfaced, or re-shared beyond the original conversational scope.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The markdown output stores summaries, pending items, and recent turns derived directly from raw conversation history in plain language. Even when not verbatim, summarization can still expose credentials, personal information, internal plans, or sensitive requests, and the saved file creates a durable leakage path if accessed by other tools, users, or later prompts.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

Most operational instructions and headings are presented in Portuguese, which can impose a locale/language choice on users who may expect neutral or selectable language behavior. The file does not indicate that Portuguese is optional, configurable, or justified as a region-specific requirement.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The heading metadata uses Portuguese ('Gerado') and the document content is written in Portuguese without any indication that the user opted into that language or that the skill is region-specific. This can indicate a locale policy issue because the file appears to assume a specific language by default.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

This plain-text file contains only Portuguese user/assistant exchanges, which indicates a fixed language context. Under the policy rule, forcing a specific language without user opt-in or documented justification is a natural-language locale policy concern.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.