Files
buryan-infra/ops/ai/tool_gateway.py
T
architect 649386f0b8
lint / hygiene (push) Failing after 22s
lint / hygiene (pull_request) Failing after 1m3s
standard / check (pull_request) Successful in 8s
[STAGE5] Tool Gateway policy registry + test
2026-11-27 21:09:53 +03:00

19 lines
648 B
Python

"""Read-only Tool Gateway policy registry (Stage 5)."""
from pathlib import Path
import yaml
PATH = Path("/root/buryan-infra/docs/architecture/REGISTRY/tool_gateway.yaml")
def load_tools():
data = yaml.safe_load(PATH.read_text())
tools = data.get("tools") or []
for t in tools:
if not t.get("gateway"):
raise ValueError("tool without gateway: %s" % t.get("name"))
if t.get("direct_prod"):
raise ValueError("direct production access forbidden: %s" % t.get("name"))
if t.get("mode") not in ("read", "write"):
raise ValueError("bad mode: %s" % t.get("name"))
return tools