Skip to content

Remove/reframe ai_appsec_sensor.py's co-occurrence-based RCE and exfiltration claims #1102

Closed

Description

@squid-protocol

Description

Epic #1025's issue #1020 (closed via PR #1038) removed prompt_injection, agentic_rce, injection_surface, obscured_payload, and memory_corruption from RISK_SCHEMA/SIGNAL_SCHEMA because they were "hallucinated" findings: the engine flagged a file as an AI exploit surface just because two unrelated regex categories (e.g. an LLM API import and a subprocess call) fired anywhere in the same file, with zero proof the data actually flows between them — something an AST-free, taint-tracking-free engine cannot structurally prove.

gitgalaxy/tools/ai_guardrails/ai_appsec_sensor.py (AIAppSecSensor.hunt_threats) has the identical logic pattern and was missed by #1020/#1038's blast-radius sweep, because it never touches RISK_SCHEMA/SIGNAL_SCHEMA at all — it writes straight to telemetry["ai_appsec"] instead, so grepping for the removed schema field names didn't surface it.

Why they are broken (same root cause as #1020)

Two of the sensor's three checks (lines ~57-108 as of this writing):

  • is_rce_funnel / "Autonomous Execution Vector": (ai_orchestrator or llm_api) and arch_api and sec_danger — flags a file just because an LLM-related regex, a public-API regex, and an eval/subprocess regex all fired somewhere in the file. Message text: "CRITICAL... Immediate Prompt Injection -> Autonomous Execution vulnerability." This is agentic_rce reborn under a new name.
  • agentic_exfiltration_risk: llm_api and arch_io and sec_secrets — same co-occurrence-without-dataflow shape as the removed injection_surface. Message text: "CRITICAL... High risk of SSRF and key exfiltration via prompt injection."

These are arguably worse than what #1020 already removed: they're surfaced by gitgalaxy/recorders/sarif_recorder.py (~line 122-133) as ruleId: GG-AGENT-VULNERABILITY at level: "error" — SARIF's error level is what GitHub code scanning and most CI gates treat as a confirmed, blocking finding, so the overclaim now has more real-world consequence than the fields already removed.

The third check, over_permissioned_agent (ai_orchestrator and arch_io and safety_density < 0.5), should NOT be removed — it was deliberately revived in #365 using ai_orchestrator (a library-import signal, i.e. detecting framework identity) rather than a behavioral claim, which the inline code comments argue is exactly the kind of signal this regex-only engine CAN honestly detect. Keep it as the precedent for what a legitimate check in this file looks like.

Action items

  • Remove is_rce_funnel and agentic_exfiltration_risk (and their two critical_warnings messages) from gitgalaxy/tools/ai_guardrails/ai_appsec_sensor.py's hunt_threats(), keeping over_permissioned_agent.
  • Update gitgalaxy/recorders/sarif_recorder.py (~line 122-133) and gitgalaxy/recorders/record_keeper.py (~line 554-556, the rce_funnel/exfiltration SQLite columns) to match — check schema/column-list/VALUES-placeholder parity per the recurring bug class noted in Remove AST-dependent Security & Vulnerability metrics (Injection, RCE, Memory) #1020's own postmortem.
  • Update gitgalaxy/tools/ai_guardrails/README.md (the "Autonomous Execution Vector" and "Agentic Exfiltration Vector" bullets under "Side 1: The AI AppSec Sensor") and docs/wiki/02-17-ai-appsec-sensor.md to drop the removed claims.
  • Update/remove affected cases in tests/security_auditing/test_ai_appsec_sensor.py.
  • Check docs/gitgalaxy_architecture_brief.md for stale prose referencing these two claims (auto-regenerated, but confirm no hand-maintained doc references them elsewhere).
  • Note in the PR whether sarif_recorder.py/record_keeper.py output touches golden-master fixtures (tests/golden_master_audit.json etc.) — if so this needs crucible_check.py + re-blessing per the Differential Scan protocol, same as Remove AST-dependent Security & Vulnerability metrics (Injection, RCE, Memory) #1020 needed despite being "downstream-only."

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope:frontier

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions