net-kingdom/tools/security_tools.py
tegwick b7749277fd
All checks were successful
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 1s
NK-WP-0054: security review; standard draft-3 as a SecurityCanon profile; agent security quickstart
Review against security-canon (Mode of Authority, SEC-DSM 1.0.0) showed the draft
restated canon rules and invented a parallel taxonomy. Draft-3 imports principal_type
and MODE @ SCOPE grants, treats break-glass as an activation, cites SEC-DSM per rule,
states the estate identities in canon terms and adds SI-15 (accountable automation:
prepare, admit, execute, verify, retain). Founder decisions and rule ids are kept.

For agents: tools/security-tools.json and make security-tools list each security tool,
the question it answers and whether an agent may run it; a test keeps the index
complete. AGENTS.md and CLAUDE.md carry the same quickstart block. Validator migration
to grants is T03b. Review record in history/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Assistant: claude-code
Assistant-Model: opus
Assistant-Process: 328925@bnt-lap001
Assistant-Session: 14b795fd-c632-4c01-8d28-e7e490c7b0ed
2026-10-24 23:12:37 +02:00

46 lines
1.5 KiB
Python

#!/usr/bin/env python3
"""Print the NetKingdom security tools index (tools/security-tools.json) for people and agents.
Offline and read-only. `--json` prints the index unchanged for machine use.
"""
from __future__ import annotations
import argparse
import json
import pathlib
import sys
INDEX = pathlib.Path(__file__).resolve().parent / "security-tools.json"
def load() -> dict:
return json.loads(INDEX.read_text(encoding="utf-8"))
def main(argv: list[str] | None = None) -> int:
parser = argparse.ArgumentParser(description=__doc__.splitlines()[0])
parser.add_argument("--json", action="store_true")
args = parser.parse_args(argv)
index = load()
if args.json:
print(json.dumps(index, indent=2))
return 0
print("NetKingdom security tools. Tool availability is not permission (SECURITY-COMPANION.md section 7).\n")
print("Start here:")
for item in index["orientation"]:
target = item.get("command") or item.get("where")
print(f" - {item['what']}: {target}")
print("\nTools (agent may run: " + ", ".join(index["agent_may_run_values"]) + "):")
for tool in index["tools"]:
print(f"\n {tool['id']} [agent may run: {tool['agent_may_run']}]")
print(f" answers: {tool['answers']}")
print(f" run: {tool['run']}")
print(f" test: {tool['test']}")
print(f" rules: {tool['standard']}")
if tool.get("note"):
print(f" note: {tool['note']}")
return 0
if __name__ == "__main__":
sys.exit(main())