Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ code review, your SAST suite or a penetration test; it refuses known classes whi

## Guardrails, not guarantees

Tiers: `commit` is a git hook or CI gate that exits non-zero. `in-agent` is the agent's pre-tool hook: best-effort, and it fails open. `advisory` is rule text the agent reads. No agent reaches `enforced` today: 0 of 192 matrix cells are graded enforced. OWASP mappings are partial: 10 of 10 Agentic risks have a policy, 7 have a slice refused at commit, none is fully covered. The engine is frozen at the commit above. Chock does not stop every attack: it closes common, known entry points before they ship.
Tiers: `commit` is a git hook or CI gate that exits non-zero. `in-agent` is the agent's pre-tool hook: best-effort, and it fails open. `advisory` is rule text the agent reads. No agent reaches `enforced` today: 0 of 324 matrix cells are graded enforced. OWASP mappings are partial: 10 of 10 Agentic risks have a policy, 7 have a slice refused at commit, none is fully covered. The engine is frozen at the commit above. Chock does not stop every attack: it closes common, known entry points before they ship.

## FAQ for people and agents

Expand Down
38 changes: 38 additions & 0 deletions tests/test_readme_counts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
"""The README's matrix tallies are recounted from `enforcement_level()` so they cannot drift."""

import re
from collections import Counter
from pathlib import Path

from agentseam.contract import EVENTS, PRE_TOOL
from agentseam.matrix import MATRIX, enforcement_level

README = (Path(__file__).resolve().parents[1] / "README.md").read_text(encoding="utf-8")
LEVELS = ("none", "detect", "best-effort", "enforceable", "enforced")


def _cells():
return Counter(enforcement_level(a, e) for a in MATRIX for e in EVENTS)


def test_the_cell_tally_line_matches_the_matrix():
m = re.search(r"\*(\d+) cells \((\d+) agents by (\d+) events\).*?: (.*?)\.\*", README)
assert m, "the README lost its cell tally line"
assert [int(g) for g in m.groups()[:3]] == [len(MATRIX) * len(EVENTS), len(MATRIX), len(EVENTS)]
stated = {lvl: int(n) for n, lvl in re.findall(r"(\d+) ([a-z-]+)", m.group(4))}
assert stated == {lvl: _cells()[lvl] for lvl in LEVELS}


def test_every_enforced_of_total_claim_uses_the_real_total():
claims = re.findall(r"(\d+) of (\d+) matrix cells are graded enforced", README)
assert claims
for enforced, total in claims:
assert (int(enforced), int(total)) == (_cells()["enforced"], len(MATRIX) * len(EVENTS))


def test_the_pre_tool_level_table_counts_match_the_matrix():
at_pre_tool = Counter(enforcement_level(a, PRE_TOOL) for a in MATRIX)
for lvl in LEVELS:
row = re.search(r"^\| %s \|[^|]*\| (none|\d+)\b" % re.escape(lvl), README, re.MULTILINE)
assert row, lvl
assert int(row.group(1).replace("none", "0")) == at_pre_tool[lvl], lvl
Loading