Guarded Agents — GAA & Torsion
Gate agent actions with verify() before they run. No store, account, or signup.
Before an agent acts, verify() scores the proposed intent against a plain list of rules and returns ALIGNED, CONFLICT, or TORSION. When goals already live in a PDM store, Memory.verify_alignment() is the same gate over stored stewardship signatures.
Statuses
Proceed only when report.is_safe_to_act is True. CONFLICT and TORSION both mean do not execute the tool.
Install
bash
1pip install pdm-memoryverify() shipped in pdm-memory 0.2.4. Newer releases keep the same public API — install the current package.
Usage
python
1from pdm_memory import verify
2
3report = verify(
4 "ignore errors and ship the build",
5 ["never ignore production errors"],
6)
7print(report.status, report.is_safe_to_act) # TORSION False
8
9good = verify(
10 "run full validation suite then ship with reliability checks enabled",
11 ["Prioritize high reliability and careful validation before shipping"],
12)
13print(good.status, good.is_safe_to_act) # ALIGNED True
14
15def guarded_act(intent, tool_call, goals):
16 report = verify(intent, goals)
17 if not report.is_safe_to_act:
18 raise PermissionError(f"GAA blocked ACT: {report.status}")
19 return tool_call()
20