# Agent Signal lab — 23 November 2026
## Try aaf-gate: five policy decisions, one offline kill-switch check

**Purpose:** aaf-gate is an Apache-2.0 Python-standard-library guard for tool calls in an existing agent, initially Hermes Agent. Check whether the deterministic gate permits a read, requires approval for a send, and rejects dangerous or unknown operations. Do this on synthetic data, with no real agent, Gmail, external calls or model credentials.

**Validation: SOURCE-REVIEWED / NOT EXECUTED.** The maintainer reports 719 local passing tests. The 1.0.0rc1 release is **not production-ready, not device-accepted, and not actively maintained**. No test was executed for this publication. Nothing here proves production safety.

### Setup, permissions and costs

Requirements: Python 3, Git, temporary checkout; code review before running third-party tests. The `core` uses only Python's standard library; no `pip install`, Docker, API key or paid plan. Only downloading the public source accesses the network. Run in a disposable environment; never attach an actual Gmail inbox, Hermes instance or private data.

```sh
git clone --depth 1 --branch v1.0.0rc1 https://github.com/buberlo/aaf-gate.git aaf-gate-lab-2026-11-23
cd aaf-gate-lab-2026-11-23/core
python3 -m framework.cli version
```

**Expected, unobserved:** JSON keys `core_version`, `schema_version`, `ok`. If the tag cannot resolve or the CLI differs, stop and verify upstream rather than fetching and running unrelated changes.

### Step 1 — inspect upstream tests

```sh
python3 -m unittest discover -s tests -p 'test_gate.py' -v
python3 -m unittest discover -s tests -p 'test_stop_switch.py' -v
```

The source contains explicit unit tests for allow/read, approval/send, deny/delete, deny/unknown tool, unattended-write denial, stopped-tenant behavior, other-tenant isolation, and audit event fields. **Record actual passing counts, not the maintainer's 719 as your result.**

### Step 2 — five no-I/O policy probes

From `core/`, run this in-memory fixture. It uses the checked `test_gate.py` request/policy schemas; no actual tool action takes place.

```sh
python3 - <<'PY'
import json
from framework.gate import decide

policy = {
  "schema_version": "gate-policy-0.1-draft",
  "tool_classes": {
    "gmail:read": "read", "gmail:draft": "draft",
    "gmail:send": "send", "gmail:*": "delete_external",
    "files:write": "internal_write"
  },
  "levels": {"read":"L4", "draft":"L4", "send":"L3", "internal_write":"L4"}
}
def req(tool, action):
  return {"schema_version":"gate-request-0.1-draft", "runtime":"local",
          "tool":tool, "action":action, "target":"synthetic-fixture",
          "content_hash":"sha256:" + "0"*64}
cases = [
  ("read", "gmail", "read", False, "allow"),
  ("send", "gmail", "send", False, "needs_approval"),
  ("delete", "gmail", "delete", False, "deny"),
  ("unknown", "terminal", "run", False, "deny"),
  ("unattended-write", "files", "write", True, "deny")
]
for label, tool, action, unattended, expected in cases:
  got = decide(req(tool, action), policy, unattended=unattended)
  print(json.dumps({"case":label,"expected":expected,
                    "observed":got.get("decision"),"reason":got.get("reason")}))
  assert got.get("decision") == expected, label
PY
```

**Expected, not observed:** read → allow (`ok`); send → needs_approval (`approval_required`); delete → deny (`level_L0`); unknown tool → deny (`action_class_unknown`); unattended file write → deny (`level_L2`). Disagreement is a real test failure, not something to edit away. None of these cases sends mail or writes files.

### Step 3 — score actual evidence

| Property | Pass condition | Points |
|---|---|---|
| Five synthetic decisions | All five match expected outcome | 5 |
| Unknown and unattended deny | Both fail closed | 2 |
| Stop-switch test | Stopped synthetic tenant denied; other tenant remains unaffected | 2 |
| Audit trail | Stop-switch test checks corresponding event outcome/reason | 1 |

Total **0–10**, plus a mandatory requirement of **zero external model/API calls**. Record commit SHA, Python version, commands, stdout/stderr, test counts and whether any case was not run. A partial run must not score as full success.

### Troubleshooting and scope

- `ModuleNotFoundError: framework`: run from the repository's `core/` folder.
- Zero tests discovered: verify tag, names under `core/tests` and test pattern; zero is not success.
- Assertion failure: retain exact decision and reason, and verify policy and `unattended` argument.
- This local exercise does not test live Hermes hooks, network permissions, SQLite failure handling on a device, multi-tenant security guarantees, or the author's uncompleted hardware acceptance.
- Do not deploy an inactive, preproduction security control on real customer or personal data solely because these tests pass.

**Primary sources checked 23 Nov:** [README](https://github.com/buberlo/aaf-gate), [v1.0.0rc1](https://github.com/buberlo/aaf-gate/releases/tag/v1.0.0rc1), [policy tests](https://github.com/buberlo/aaf-gate/blob/main/core/tests/test_gate.py), [stop-switch tests](https://github.com/buberlo/aaf-gate/blob/main/core/tests/test_stop_switch.py), [status](https://github.com/buberlo/aaf-gate/blob/main/docs/v1/STATUS.md).
