Repository navigation
docs(threat-model): one pass over automations' entries, each naming its mitigation and test - #612
Merged
Merged
Conversation
…ts mitigation and test
Workflow studio M12, item 2. Each automations entry now names its mitigation and the backend tests that prove it:
- inbound webhooks (POST /automations/hooks/{token}): test_automation_hooks.py
- outbound http_request (P-SSRF-GUARD): test_actions_web.py
- the agent acting on outside text (P-INJECTION-EGRESS, P-AUTOMATION-ACTOR): test_actions_ai.py,
test_automation_nodes.py, test_automation_vars.py, test_automation_runs.py
- approvals decided in chat rooms and the 100-waiting cap (P-AUTOMATION-APPROVAL): test_approvals.py,
test_approvals_chat.py
- loop amplification (P-AUTOMATION-LOOP): test_automation_runs.py
- timers flooding: the 1000-waiting cap per automation, missing from the model, is added to P-AUTOMATION-LOOP
(test_timers.py)
- `matches` cost: the /api/v1/automations row now names the bound as its companions did; test_match_ops.py
The prose cites them as "Tested by"; the YAML and JSON carry them as x-tests. ci/validate_threat_model.py now fails
when a cited test file or function is gone, and the threat model workflow also runs when fastapi_backend/tests
changes, so a citation can't outlive its test.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AjJqXgjj1cNdKGRQbX5frb
# Conflicts: # threat-model.md
6 of 8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Adeel · project thread
Description
Before: the threat model's automation entries named their mitigations but not the tests that prove them. The cap of 1000 waiting timers per automation was in
docs/automations.mdbut missing from the threat model.After: each of the seven areas the studio brief lists names its mitigation and cites its tests:
fastapi_backend/tests/)POST /automations/hooks/{token}rowapi/test_automation_hooks.py(hash only, size and rate caps, signatures and retries),api/test_automations.py(address made and dropped with its trigger)http_requestapi/test_actions_web.py(public addresses only, no redirects, 10 s and 64 KB, asks first)api/test_actions_ai.py,domain/test_automation_nodes.py,api/test_automation_vars.py,domain/test_automation_runs.py,api/test_automation_tools.pyapi/test_approvals_chat.py,api/test_approvals.pydomain/test_automation_runs.pydomain/test_timers.py,api/test_approvals.pymatches)matchesparagraph and the/api/v1/automationsrowdomain/test_match_ops.pyThe citations are a "Tested by" note at the end of each row in the prose, and an
x-testslist in the YAML and JSON.ci/validate_threat_model.pynow fails when a cited test file or function no longer exists. The threat model workflow also runs when backend tests change, so renaming a cited test fails CI at once.Motivation and Context
Workflow studio M12, Build step 2: "One pass over every module's entries ... Make sure each names its mitigation and test." It follows AGENTS.md's flywheel, where a broken rule becomes a test: a citation that goes stale now turns CI red.
Gaps found, none needing new behaviour, noted for later:
matchespatterns is enforced and tested, but not documented.Types of changes
!in the title)Checklist:
make hookschecks it on commit).ci/test_validate_threat_model.py::test_cited_tests_must_exist.threat-model.md,.yamland.json.Checks run:
python3 ci/validate_threat_model.py --base origin/main: "prose, YAML and JSON agree".Rebased on main: kept main's new P-APPROVAL wording beside these rows.
Done questions (AGENTS.md)
Generated by Claude Code