Back to skill

Security audit

rsi-skill

Security checks for vulnerabilities and agentic risk

Overview

This skill evaluates and improves user-provided prompts with disclosed model API calls and requires approval before applying revisions.

Check the selected endpoint before running: an existing OPTIQ_CLOUD_KEY takes priority over local service discovery. Use a trusted endpoint for private prompts, protect locally saved results, consider API costs, and review proposed changes before approving them.

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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (5)

Tainted flow: 'req' from os.environ.get (line 41, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/rsi.py (reported line 42)May include surrounding context.

python
def _get(url: str, key: str | None, timeout: float = 5.0):
    req = urllib.request.Request(url, headers={"Authorization": f"Bearer {key}"} if key else {})
    with urllib.request.urlopen(req, timeout=timeout) as r:
        return json.load(r)

Tainted flow: 'req' from os.environ.get (line 96, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/rsi.py (reported line 97)May include surrounding context.

python
for attempt in range(6):
        try:
            req = urllib.request.Request(be["base"] + "/chat/completions", data=body, headers=headers)
            with urllib.request.urlopen(req, timeout=300) as r:
                return (json.load(r)["choices"][0]["message"].get("content") or "").strip()
        except urllib.error.HTTPError as e:
            if e.code in (429, 500, 502, 503, 504) and attempt < 5:

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/rsi.py (reported line 218)May include surrounding context.

python
cases = [json.loads(l) for l in (dirp / "cases.jsonl").read_text().splitlines() if l.strip()]
    if not cases:
        sys.exit("cases.jsonl is empty")
    return prompt, cases


def cmd_init(a):

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: env, file_read, file_write, network.

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/rsi.py (reported line 76)May include surrounding context.

python
if ms:
        return {"base": OPTIQ_LOCAL, "key": None, "model": args.model or ms[0], "why": "local optiq serve is running"}
    if os.environ.get("OPENAI_BASE_URL") or os.environ.get("OPENAI_API_KEY"):
        base = os.environ.get("OPENAI_BASE_URL", "https://api.openai.com/v1").rstrip("/")
        key = os.environ.get("OPENAI_API_KEY")
        return {"base": base, "key": key, "model": args.model or (_models(base, key) or [None])[0], "why": "OPENAI_BASE_URL/OPENAI_API_KEY"}
    sys.exit("No model endpoint found. Pick one:\n"