🛑 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
🛑 Problem Statement
galaxyscope.py's "Phase 5: Zero-Trust Guardrails" runsAIAppSecSensor.hunt_threats()andDevAgentFirewall.evaluate_ecosystem()unconditionally on every single scan, regardless ofwhether 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 theexisting
self.config.get(...)mechanism sourced from--config <path>.galaxyscope.yaml.This showed up while evaluating whether
gitgalaxy/security/andgitgalaxy/tools/should bereorganized (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) whilestill paying the full per-file scan cost for every file in the repo.
Note: whether
ai_appsec_sensor.py/dev_agent_firewall.pyshould also move out ofgitgalaxy/tools/ai_guardrails/(they currently have no standalone entry point orpyproject.tomlregistration, unlike everything else undertools/) is a related but separatequestion — 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: trueto disable), preservingtoday'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)
SKIP_AI_GUARDRAILS, defaultFalse) read the same wayFAIL_ON_SECRETS/FAIL_ON_MALWAREalready are.galaxyscope.py's Phase 5 block behindif not self.config.get("SKIP_AI_GUARDRAILS"):, mirroring the existing conditional-phasepattern already used for
SBOM_ONLY/AUDIT_ONLY/etc. elsewhere in the same file.record_keeper.pyandthe 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 thancrashing — needs an explicit test proving it, not just an assumption.
--skip-ai-guardrailsCLI flag mirroring the existing--sbom-only-style argparse wiring,for parity with how other exclusive/skip behaviors are exposed.
large COBOL-modernization scan with no agentic surface).
✅ Acceptance Criteria
skipped)
(
tools/ai_guardrails/vs.security/) gets bundled into this work or stays a separatefollow-up