Back to skill

Security audit

ia-simplifying-code

Security checks for vulnerabilities and agentic risk

Overview

This skill gives conservative code-simplification guidance and does not show hidden execution, persistence, credential access, or unrelated behavior.

Install this skill if you want stricter code-simplification discipline. It may guide the agent to edit or delete code during requested refactors, so review diffs and verification results, especially when guards, comments, public APIs, or broad renames are involved.

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
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (3)

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · SPEC.md (reported line 16)May include surrounding context.

md
Out of scope:
- Acting as the runtime instructions themselves (those live in `SKILL.md`).
- Trigger phrasings already covered by adjacent `ia-*` skills (`validate-plugin` flags >70% description overlap as DUPLICATE_TRIGGER).
- <!-- to fill in: domain-specific exclusions when the skill drifts -->

## Trigger Context

Self-Modification

High
Category
Rogue Agent
Confidence
70% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · references/simplification-patterns.md (reported line 25)May include surrounding context.

md
- **Redundant comments** that restate the code (`// increment counter` above `counter++`): delete them. A comment that carries behavior is not redundant even when it sits beside a short line: keep one that says why the line exists, names a workaround or upstream bug, states an invariant, or pins an ordering constraint. Treat directive comments as code (`// @ts-expect-error`, `// eslint-disable-next-line`, `# noqa`, `# type: ignore[...]`, `# pragma: no cover`, `// phpcs:ignore`, `@phpstan-ignore-next-line`, docblock annotations a framework reads); remove one only after rerunning its tool without it and seeing the run stay clean. Keep license and legal headers; no tool rerun can clear their removal
- **Wrong comments** on lines this pass touches (list others as follow-ups): fix or remove one when one of these holds. *Stale*: describes behavior the code no longer has. *Orphaned*: names a symbol, path, flag, or ticket that no longer exists. *Misleading*: states a claim the code contradicts. Rewrite when the correct claim is proven from the code; otherwise delete. Never change code to make a comment true
- **Unnecessary defensive checks** for conditions that cannot occur in context: remove the guard. Where the guard, retry, workaround, or flag counters an *external* hazard (a harness default, an upstream bug, a race, a platform quirk), "cannot occur" needs evidence: demonstrate the hazard's precondition is present and handled. A green suite is not that evidence when the run may never have triggered the hazard at all; absence of failure and absence of the hazard look identical from the outside. If the precondition cannot be reproduced, keep the code and record the gap. Guards against conditions the type system already excludes need no such proof, provided the type is enforced at that boundary rather than merely declared; deserialized payloads, unchecked API responses, and anything reached through a cast or assertion do not qualify
- **Gratuitous type casts** (`as any`, `a
...[truncated 25 chars]

Scope Creep

Low
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill's behavior or capabilities extend beyond its stated purpose. Scope creep allows an agent to perform actions unrelated to its documented functionality, increasing the attack surface.

Content

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

md
## Constraints

- Only simplify what was requested; do not add features, expand scope, introduce new dependencies, or add speculative configurability or flexibility the request did not ask for
- Leave unchanged code untouched; do not add comments, docstrings, or type annotations to lines that were not simplified
- Do not bundle unrelated cleanups into one patch; each simplification should be a coherent, reviewable unit
- Do not introduce framework-wide patterns while simplifying a small local change

Static analysis

No suspicious patterns detected.