[Phase 0.2.1] Create security test suite scaffold#36
Open
richard-devbot wants to merge 3 commits intoCursorTouch:mainfrom
Open
[Phase 0.2.1] Create security test suite scaffold#36richard-devbot wants to merge 3 commits intoCursorTouch:mainfrom
richard-devbot wants to merge 3 commits intoCursorTouch:mainfrom
Conversation
Creates tests/security/ with shared fixtures (tmp_workspace, mock_agent_context, capture_logs), attack payload generators (path traversal, command injection), assertion helpers (assert_blocked, assert_allowed), and an example test that validates the scaffold itself — all 15 tests passing. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1bb1f38 to
2154940
Compare
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.
Closes #7
What was implemented
tests/security/__init__.py— package marker with module docstringtests/security/conftest.py— three shared fixtures:tmp_workspace— isolated temp directory withfiles/andlogs/subdirs; auto-cleaned by pytestmock_agent_context— minimal{workspace, agent_id, permissions}dict for tool testing without full agent objectscapture_logs— wrapscaplogat DEBUG level so security log lines at any severity are capturedtests/security/helpers.py— utilities for Phase 1 security tests:path_traversal_payloads()— 8 classic../, URL-encoded, and absolute-path attack stringscommand_injection_payloads()— 8 shell injection fragments (;,|,&, backtick,$(), etc.)assert_blocked(result, check=None)— assertsresult.success is False; optional extra predicateassert_allowed(result, check=None)— assertsresult.success is True; optional extra predicatetests/security/test_scaffold.py— 15 passing example tests exercising every fixture and helperTest run
All fixtures are fully documented with docstrings per the acceptance criteria.