Back to skill

Security audit

Self-improvement-loop-v3

Security checks for vulnerabilities and agentic risk

Overview

This skill is not malware, but it needs review because it can persist run history and automatically revise goals while overstating the strength of its audit trail.

Install only if you are comfortable with a local orchestration tool that writes persistent run artifacts and may automatically revise success criteria. Use a dedicated output directory, review generated revised_specification.json before relying on it, consider running with --no-auto-revise for important targets, and do not treat the improvement chain as cryptographic signing or tamper-proof audit evidence.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/signal_router.py:185
Finding

Improvement Chain Does Not Authenticate the Underlying Reports

Content
View full analysis
tuple: """ Append a new report to the improvement chain. Each link contains: report_id, report_hash, prior_hash, timestamp. Returns (updated_chain, link). """ prior_hash = chain[-1]["report_hash"] if chain else "genesis" # Build the link payload (exclude integrity field to avoid circular hash) link_payload = { "report_id": report.get("report_id"), "prior_hash": prior_hash, "cycle": report.get("cycle", 1), "performance_score": report.get("summary", {}).get("performance_score"), "alignment_score": report.get("summary", {}).get("alignment_score"), "timestamp": datetime.now(timezone.utc).isoformat() } link_hash = sha256_dict(link_payload) link = { **link_payload, "report_hash": link_hash } updated_chain = chain + [link] return updated_chain, link def verify_chain(chain: list) -> dict: """ Verify the integrity of an improvement chain by re-computing all hashes and checking that each link's prior_hash matches the previous link's report_hash. """ if not chain: return {"valid": True, "links": 0, "message": "Empty chain — nothing to verify"} errors = [] for i, link in enumerate(chain): # Re-compute expected hash payload = {k: v for k, v in link.items() if k != "report_hash"} expected_hash = sha256_dict(payload) actual_hash = link.get("report_hash", "") if expected_hash != actual_hash: errors.append(f"Link {i+1} (report_id={link.get('report_id')}): hash mismatch — expected {expected_hash[ ...[truncated 3212 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/signal_router.py:79
Finding

Direction Errors Suppress Drift and Can Autonomously Weaken Success Criteria

Content
View full analysis
0: gap = max(0.0, (target - actual) / target) else: gap = 0.0 criteria_checks.append({ "criterion": criterion, "target": target, "actual": actual, "gap": round(gap, 4) }) criteria_drift += gap ``` From `scripts/capability_expander.py:68-79`: ```python if len(failures) >= threshold: recent = failures[-threshold:] if not any(f["met"] for f in recent): # Never met in the last `threshold` cycles actuals = [f["actual"] for f in recent if f["actual"] is not None] best_actual = max(actuals) if actuals else None impossible.append({ "criterion": criterion, "target": target, "best_actual": best_actual, "consecutive_failures": len(recent), "history": recent }) ``` From `scripts/capability_expander.py:82-105`: ```python def _compute_revised_target(criterion: str, target: float, best_actual: Optional[float], history: list) -> dict: """ Compute a revised target for an impossible criterion. Strategy: use the best observed actual value with a 10% buffer, or reduce the target by 20% if no actuals are available. """ if best_actual is not None and best_actual > 0: # Set revised target to best_actual * 0.95 (5% below best observed) # T ...[truncated 3692 chars]
Remediation
View remediation
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (8)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill explicitly describes autonomous execution, automatic feedback-driven iteration, regression test generation, and feeding improvements back into future cycles, but it does not present a corresponding warning about system changes, data writes, or operational side effects. In context, the skill also claims it can auto-update files like learnings logs, similarity indexes, and improvement chains, making silent persistence and repeated modification materially risky.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The activation guidance is extremely broad: 'use this skill whenever you need to take a goal from raw language all the way to a verified, continuously improving implementation — in one command.' That can cause the skill to be invoked for many ordinary requests and, once invoked, it advertises autonomous execution and self-modifying behavior, increasing the chance of unintended actions on user data or the local environment.

Content

No source excerpt is available for this finding.

Unbounded Resource Access

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill allows unbounded resource consumption (API calls, storage, compute). Without rate limits or quotas, a compromised or misbehaving agent can cause denial-of-service or cost overruns.

Content

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

md
**What it is:** When the system detects that a specification is no longer achievable given observed constraints (e.g. a success criterion of `duration_ms < 500` that has never been met in 5 cycles), it autonomously generates a revised specification with adjusted criteria, documents the revision rationale, and continues the pipeline — without human intervention.

**Why it matters:** Current AI systems fail silently or loop forever on impossible goals. This system detects impossibility, documents it, adjusts, and continues. The human gets a clear audit trail of what was attempted, what was impossible, and what was substituted — rather than a system that either crashes or silently lowers its own bar.

**How it works:** `pipeline.py` tracks `consecutive_failures` per success criterion. After a configurable threshold (default: 3), it calls `capability_expander.py` which generates a `revised_specification.json` with adjusted criteria and a `revision_rationale.md` explaining the change. The pipeline continues with the revised spec and flags the cycle as `auto_revised`.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The stated design intentionally permits autonomous re-specification when goals appear unachievable, which can weaken requirements without human authorization. In security-sensitive or quality-critical pipelines, an attacker or bad input history could drive the system to lower acceptance criteria, causing spec drift and making failing systems appear compliant.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The script automatically emits revised_specification.json and rationale files based on computed failure history, effectively changing downstream decision inputs without requiring confirmation or a safety interlock. In an autonomous pipeline, this can silently normalize degraded goals and propagate weakened specifications into later stages, undermining governance and integrity of the workflow.

Content

No source excerpt is available for this finding.

Tainted flow: 'existing' from pathlib.Path.read_text (line 226, file read) → pathlib.Path.write_text (file write)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · scripts/meta_learner.py (reported line 261)May include surrounding context.

python
"updated_at": datetime.now(timezone.utc).isoformat()
        })

    index_path.write_text(json.dumps(existing, indent=2))
    return existing

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The module docstring states that when criteria become unachievable, the system revises the specification and allows the pipeline to continue 'without human intervention.' However, the generated rationale later tells users to review revised targets to ensure they remain meaningful, which contradicts the claim of fully autonomous continuation. This is a documentation-to-behavior intent mismatch rather than a code safety issue.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The _run_feedback_loop docstring says it 'Returns (observation, analysis, improvement_report)', which contradicts the surrounding description 'Run the feedback loop analysis' if interpreted as a single analysis result; more importantly, callers must handle three returned values, not one. This is an intent/documentation mismatch that could mislead maintainers about the function's interface and side effects.

Content

No source excerpt is available for this finding.