🛑 Problem Statement
gitgalaxy/tools/ai_guardrails/ai_appsec_sensor.py and dev_agent_firewall.py are miscategorized.
gitgalaxy/tools/ is documented (in tools/README.md) and, for everything else in it, actually
true as a suite of standalone, independently-invocable CLIs — each registered as its own
pyproject.toml console script (vault-sentinel, pii-leak-hunter, api-network-map, the
cobol-* tools, etc.) with a real if __name__ == "__main__"/argparse entry point.
These two files have neither. No standalone entry point, no pyproject.toml registration —
tools/README.md's "Dual-Sided AI Guardrails" section currently describes them as independently
runnable "Deep-inspection middleware sensors," which isn't accurate; there is no way to invoke
them except as part of the main engine run. galaxyscope.py imports both directly and runs them
unconditionally in "Phase 5: Zero-Trust Guardrails" on every single scan — architecturally
identical to how security_lens.py/security_auditor.py (already in gitgalaxy/security/) are
unconditionally run as core phases. Further evidence this is a location bug, not a naming
preference: their existing tests already live in tests/security_auditing/
(test_ai_appsec_sensor.py, test_dev_agent_firewall.py), not anywhere under a tests/tools/
equivalent — the test suite already treats them as security-domain code.
Surfaced while evaluating whether gitgalaxy/security/ and gitgalaxy/tools/ needed
reorganizing; everything else flagged in that pass turned out to be an intentional, sensible split
(see that discussion) — this is the one real mismatch.
🎯 Objective
Move both files into gitgalaxy/security/, update the two import lines in galaxyscope.py, and
correct both READMEs so they describe reality.
🛠️ Proposed Implementation
git mv gitgalaxy/tools/ai_guardrails/ai_appsec_sensor.py gitgalaxy/security/ai_appsec_sensor.py
and same for dev_agent_firewall.py. gitgalaxy/security/ is currently flat (no subfolders) —
match that convention rather than introducing a new security/ai_guardrails/ subfolder, unless
whoever picks this up has a good reason to prefer the subfolder.
- Update
galaxyscope.py's two import lines (currently
from gitgalaxy.tools.ai_guardrails.ai_appsec_sensor import AIAppSecSensor and the
dev_agent_firewall equivalent).
- Remove
gitgalaxy/tools/ai_guardrails/ entirely once empty (including its own README section)
if nothing else lives there.
- Update
tools/README.md: remove or correct the "Dual-Sided AI Guardrails" section so it no
longer claims these are standalone-runnable.
- Update
gitgalaxy/security/README.md's module breakdown to document these two as part of the
core security suite, matching its existing style for security_lens.py/security_auditor.py.
- Sweep for any other stale references to the old import path (docs, comments — e.g.
gitgalaxy/core/spatial_correlation.py has a comment mentioning dev_agent_firewall.py/
ai_appsec_sensor.py by basename only, so it's unaffected either way, but worth a full repo grep
rather than assuming).
- Pure code-organization change, no behavior change — full test suite +
audit_check.py should be
sufficient verification; a golden-master rebless shouldn't be needed, but confirm with
crucible_check.py anyway since it touches galaxyscope.py's import wiring.
Related: #1178 (making this phase optional) touches the same two files — no required ordering
between the two, but worth noting in whichever PR lands second that the other is in flight, to
avoid a merge conflict on the same galaxyscope.py lines.
✅ Acceptance Criteria
🛑 Problem Statement
gitgalaxy/tools/ai_guardrails/ai_appsec_sensor.pyanddev_agent_firewall.pyare miscategorized.gitgalaxy/tools/is documented (intools/README.md) and, for everything else in it, actuallytrue as a suite of standalone, independently-invocable CLIs — each registered as its own
pyproject.tomlconsole script (vault-sentinel,pii-leak-hunter,api-network-map, thecobol-*tools, etc.) with a realif __name__ == "__main__"/argparse entry point.These two files have neither. No standalone entry point, no
pyproject.tomlregistration —tools/README.md's "Dual-Sided AI Guardrails" section currently describes them as independentlyrunnable "Deep-inspection middleware sensors," which isn't accurate; there is no way to invoke
them except as part of the main engine run.
galaxyscope.pyimports both directly and runs themunconditionally in "Phase 5: Zero-Trust Guardrails" on every single scan — architecturally
identical to how
security_lens.py/security_auditor.py(already ingitgalaxy/security/) areunconditionally run as core phases. Further evidence this is a location bug, not a naming
preference: their existing tests already live in
tests/security_auditing/(
test_ai_appsec_sensor.py,test_dev_agent_firewall.py), not anywhere under atests/tools/equivalent — the test suite already treats them as security-domain code.
Surfaced while evaluating whether
gitgalaxy/security/andgitgalaxy/tools/neededreorganizing; everything else flagged in that pass turned out to be an intentional, sensible split
(see that discussion) — this is the one real mismatch.
🎯 Objective
Move both files into
gitgalaxy/security/, update the two import lines ingalaxyscope.py, andcorrect both READMEs so they describe reality.
🛠️ Proposed Implementation
git mv gitgalaxy/tools/ai_guardrails/ai_appsec_sensor.py gitgalaxy/security/ai_appsec_sensor.pyand same for
dev_agent_firewall.py.gitgalaxy/security/is currently flat (no subfolders) —match that convention rather than introducing a new
security/ai_guardrails/subfolder, unlesswhoever picks this up has a good reason to prefer the subfolder.
galaxyscope.py's two import lines (currentlyfrom gitgalaxy.tools.ai_guardrails.ai_appsec_sensor import AIAppSecSensorand thedev_agent_firewallequivalent).gitgalaxy/tools/ai_guardrails/entirely once empty (including its own README section)if nothing else lives there.
tools/README.md: remove or correct the "Dual-Sided AI Guardrails" section so it nolonger claims these are standalone-runnable.
gitgalaxy/security/README.md's module breakdown to document these two as part of thecore security suite, matching its existing style for
security_lens.py/security_auditor.py.gitgalaxy/core/spatial_correlation.pyhas a comment mentioningdev_agent_firewall.py/ai_appsec_sensor.pyby basename only, so it's unaffected either way, but worth a full repo greprather than assuming).
audit_check.pyshould besufficient verification; a golden-master rebless shouldn't be needed, but confirm with
crucible_check.pyanyway since it touchesgalaxyscope.py's import wiring.Related: #1178 (making this phase optional) touches the same two files — no required ordering
between the two, but worth noting in whichever PR lands second that the other is in flight, to
avoid a merge conflict on the same
galaxyscope.pylines.✅ Acceptance Criteria
gitgalaxy/security/;gitgalaxy/tools/ai_guardrails/no longerexists
galaxyscope.pyimports updated; full test suite passes unchangedtools/README.mdandgitgalaxy/security/README.mdboth describe realityaudit_check.pyclean;crucible_check.pyconfirms no output drift