f2f7aa5dc9
Implement multiple Stage A/B/E/SEC milestones for the v3 lifecycle system: - Stage A5.3+A5.4: Add LifecycleActionModel and LifecyclePlanModel SQLAlchemy models with to_domain()/from_domain() conversion methods - Stage A5.6: Implement ActionRepository with full CRUD, namespace/state queries, referential integrity checks, and retry decorator - Stage E1: Add subplan domain models (ExecutionMode, SubplanMergeStrategy, SubplanConfig, SubplanStatus, SubplanAttempt, SubplanFailureHandler) with computed properties on Plan (is_subplan, is_root_plan, depth, has_subplans) - Stage A6: Add AutomationLevel enum (MANUAL, REVIEW_BEFORE_APPLY, FULL_AUTOMATION), settings integration, PlanLifecycleService auto-progression, pause/resume, and CLI commands (--automation-level, set-automation-level) - Stage SEC1: Remove eval()/exec() from stream_router.py, replace with named operation and transform registries; code blocks and unregistered transforms now raise StreamRoutingError - Add langchain-anthropic dependency - Update BDD tests for security changes and relax ADR directory requirement
48 lines
2.4 KiB
Gherkin
48 lines
2.4 KiB
Gherkin
Feature: SEC1 - eval/exec removal security
|
|
As a security-conscious developer
|
|
I want to verify that eval() and exec() are fully removed from config parsing
|
|
So that code injection attacks are impossible
|
|
|
|
Scenario: Config with code injection attempt is rejected
|
|
Given a SimpleToolAgent configured with a code injection payload
|
|
When I attempt to process content through the injected agent
|
|
Then the agent should reject the code block with a routing error
|
|
And the error message should mention code blocks are not supported
|
|
|
|
Scenario: Malicious transform expression does not execute
|
|
Given the CleverAgents reactive system is available
|
|
When I configure a transform with a malicious eval expression
|
|
Then the transform should be rejected with a routing error
|
|
And the error message should mention unknown transform
|
|
|
|
Scenario: Valid config still works after eval removal
|
|
Given a SimpleToolAgent configured with a named operation "uppercase"
|
|
When I process "hello" through the named operation agent
|
|
Then the named operation result should be "HELLO"
|
|
|
|
Scenario: Named transform from registry works after eval removal
|
|
Given the CleverAgents reactive system is available
|
|
When I configure a transform with a registered named function "uppercase"
|
|
Then the named transform should produce the uppercased result
|
|
|
|
Scenario: Code block with import attempt is rejected
|
|
Given a SimpleToolAgent configured with an import injection payload
|
|
When I attempt to process content through the injected agent
|
|
Then the agent should reject the code block with a routing error
|
|
|
|
Scenario: Eval expression mimicking registry name is still rejected
|
|
Given the CleverAgents reactive system is available
|
|
When I configure a transform with expression "lambda x: __import__('os').system('rm -rf /')"
|
|
Then the transform should be rejected with a routing error
|
|
|
|
Scenario: Custom registered operation works
|
|
Given a SimpleToolAgent with a custom registered operation "reverse"
|
|
When I process "abcde" through the custom operation agent
|
|
Then the custom operation result should be "edcba"
|
|
|
|
Scenario: Custom registered transform works
|
|
Given the CleverAgents reactive system is available
|
|
And a custom transform "double" is registered
|
|
When I configure a transform with a registered named function "double"
|
|
Then the custom transform should produce the doubled result
|