Skip to content

Enhancement: make the AI Guardrails phase (ai_appsec_sensor/dev_agent_firewall) optional #1178

Description

@squid-protocol

🛑 Problem Statement

galaxyscope.py's "Phase 5: Zero-Trust Guardrails" runs AIAppSecSensor.hunt_threats() and
DevAgentFirewall.evaluate_ecosystem() unconditionally on every single scan, regardless of
whether the target repository has any AI/agentic code surface at all. There's currently no config
flag to skip it — unlike most of the engine's other optional behavior (FAIL_ON_SECRETS,
FAIL_ON_MALWARE, SBOM_ONLY, FILE_SPEED, etc.), all of which are already gated through the
existing self.config.get(...) mechanism sourced from --config <path>.galaxyscope.yaml.

This showed up while evaluating whether gitgalaxy/security/ and gitgalaxy/tools/ should be
reorganized (see the discussion that produced this issue). Separately from where these two files
live, there's a real functional gap: for a large, legitimate slice of GitGalaxy's own stated use
cases — e.g. the mainframe/COBOL modernization suite, or any legacy codebase with zero LLM/agent
surface — this phase produces nothing but 0/false-valued columns (agentic_isolation_risk,
hallucination_zone, requires_hitl, silent_mutation_risk, over_permissioned_agent) while
still paying the full per-file scan cost for every file in the repo.

Note: whether ai_appsec_sensor.py/dev_agent_firewall.py should also move out of
gitgalaxy/tools/ai_guardrails/ (they currently have no standalone entry point or
pyproject.toml registration, unlike everything else under tools/) is a related but separate
question — not a blocker for this issue, and not something this issue decides on its own.

🎯 Objective

Work out what it would actually take to make this phase skippable, and whether it should be:
(a) an opt-out flag (phase runs by default, e.g. SKIP_AI_GUARDRAILS: true to disable), preserving
today's behavior for anyone not already setting a config; or (b) something auto-detected (e.g. skip
automatically when GuideStar's own manifest/import signals show zero AI/LLM ecosystem presence).
Recommend (a) as the safer default — this is security-postures-affecting behavior, and a silent
auto-skip could quietly weaken coverage for a repo that does have agentic code the heuristic
missed.

🛠️ Proposed Implementation (starting point, not prescriptive)

  • Add a new config key (working name: SKIP_AI_GUARDRAILS, default False) read the same way
    FAIL_ON_SECRETS/FAIL_ON_MALWARE already are.
  • Gate the two calls in galaxyscope.py's Phase 5 block behind
    if not self.config.get("SKIP_AI_GUARDRAILS"):, mirroring the existing conditional-phase
    pattern already used for SBOM_ONLY/AUDIT_ONLY/etc. elsewhere in the same file.
  • Verify downstream consumers degrade cleanly when the phase is skipped: record_keeper.py and
    the other recorders already read tel.get("ai_guardrails", {})/tel.get("ai_appsec", {}) via
    .get(...) with defaults, so this should already degrade gracefully to 0/false rather than
    crashing — needs an explicit test proving it, not just an assumption.
  • Add a --skip-ai-guardrails CLI flag mirroring the existing --sbom-only-style argparse wiring,
    for parity with how other exclusive/skip behaviors are exposed.
  • Document the new flag (README/config docs) with a concrete example of when to use it (e.g. a
    large COBOL-modernization scan with no agentic surface).

✅ Acceptance Criteria

  • New config flag added; default behavior is unchanged (phase still runs unless explicitly
    skipped)
  • Test proving the skip path doesn't break downstream recorders/columns
  • Test proving the default (non-skip) path is unaffected
  • Documented with a real example use case
  • Explicit note in the PR/issue resolution on whether the file-location question
    (tools/ai_guardrails/ vs. security/) gets bundled into this work or stays a separate
    follow-up

Metadata

Metadata

Assignees

No one assigned

    Labels

    appsecAgentic guardrails, prompt injection, and RCE sensorsenhancementNew feature, sensor, or structural signaturepriority: lowUI tweaks, documentation, and minor optimizationsquestionFurther information or community discussion requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions