Problem
pycodeloop tools use a binary dangerous: bool flag. This forces an all-or-nothing choice: either all dangerous tools require human confirmation, or none do. There is no way to allow low-risk mutations autonomously while still requiring approval for high-risk ones.
Expected behavior
codeloop = CodeLoop(config=Config(
autonomy="safe_execute", # allow reads + low-risk writes, require approval for high-risk
))
Policy table:
| Level |
read |
execute_low_risk |
execute_high_risk |
manual |
allow |
require_approval |
deny |
safe_execute |
allow |
allow |
require_approval |
full_project_loop |
allow |
allow |
allow |
Suggested implementation
- Add
AutonomyLevel enum in pycodeloop/core/autonomy.py
- Add
operation: str class attribute to tools: "read", "execute_low_risk", "execute_high_risk"
- Replace
tool.dangerous → confirm check in Agent._execute() with gate(level, tool.operation) -> GateDecision
- Add
autonomy: str = "safe_execute" to Config
- Record gate decisions in JSONL trace
References
- "Code as Agent Harness" — arXiv 2605.18747, Section 3.1 (Harness interface)
Problem
pycodeloop tools use a binary
dangerous: boolflag. This forces an all-or-nothing choice: either all dangerous tools require human confirmation, or none do. There is no way to allow low-risk mutations autonomously while still requiring approval for high-risk ones.Expected behavior
Policy table:
manualsafe_executefull_project_loopSuggested implementation
AutonomyLevelenum inpycodeloop/core/autonomy.pyoperation: strclass attribute to tools:"read","execute_low_risk","execute_high_risk"tool.dangerous→confirmcheck inAgent._execute()withgate(level, tool.operation) -> GateDecisionautonomy: str = "safe_execute"toConfigReferences