Description
Create an adversarial testing suite that simulates agent key compromise scenarios, testing that the agent cannot escalate privileges beyond its designated permissions.
Use Case
If the agent key is compromised, the attacker should not be able to steal funds, change ownership, or modify critical configuration. This testing suite validates those guarantees.
Attack Scenarios to Test
- Agent tries to call owner-only functions (set_caps, transfer_ownership, etc.)
- Agent tries to withdraw user funds directly
- Agent tries to modify contract storage directly
- Agent tries to pause/unpause the vault
- Agent tries to upgrade the contract
- Agent tries to set pool addresses to drain contracts
- Agent tries to manipulate TotalAssets arbitrarily
- Agent tries to front-run user deposits
Acceptance Criteria
- Comprehensive test file: test_agent_compromise_scenarios.rs
- Each attack scenario as separate test function
- All attacks must fail with appropriate error
- Code coverage for all agent entry points
- Negative test for every owner-only function
- Document in SECURITY.md threat model
Technical Notes
- Extend existing OwnerCompromiseBlastRadius.test.ts pattern
- On-chain tests using Soroban test environment
Description
Create an adversarial testing suite that simulates agent key compromise scenarios, testing that the agent cannot escalate privileges beyond its designated permissions.
Use Case
If the agent key is compromised, the attacker should not be able to steal funds, change ownership, or modify critical configuration. This testing suite validates those guarantees.
Attack Scenarios to Test
Acceptance Criteria
Technical Notes