Adversarial tests verifying Tenuo's security properties.
# Verify all security properties in 30 seconds
pytest tests/security/ -v --tb=short
# Expected: 43 passed, 0 failed# Run all security tests
pytest tests/security/ -v
# Run specific category
pytest tests/security/test_signature_trust.py -v
# Run with verbose output
pytest tests/security/ -v -s
# Run only integration responsibility tests (expected to document, not fail)
pytest tests/security/ -m integration_responsibility -v| Category | File | Tests | Status |
|---|---|---|---|
| Signature/Trust | test_signature_trust.py |
5 | ✅ All pass |
| Monotonicity | test_monotonicity.py |
11 | ✅ All pass |
| PoP Binding | test_pop_binding.py |
6 | ✅ All pass |
| Delegation Limits | test_delegation_limits.py |
6 | ✅ All pass |
| Implementation | test_implementation.py |
9 | ✅ All pass |
| Edge Cases | test_edge_cases.py |
6 | ✅ All pass |
@pytest.mark.security # All security tests
@pytest.mark.signature # Signature/trust verification
@pytest.mark.monotonicity # Capability attenuation rules
@pytest.mark.pop # Proof-of-Possession binding
@pytest.mark.delegation # Delegation depth/chain limits
@pytest.mark.implementation # Implementation-level bypasses
@pytest.mark.integration_responsibility # App responsibilities (not Tenuo bugs)- Signature verification - Warrants signed by attacker keys rejected
- Root trust - Only trusted roots accepted by Authorizer
- Holder binding - PoP signature requires correct keypair
- PoP binding - Signature covers (tool, args, timestamp)
- Tool narrowing - Cannot add tools not in parent
- Constraint narrowing - Cannot widen Pattern, Range, OneOf
- Type safety - Cannot change constraint types
- TTL shrinking - Cannot extend expiration
- No re-widening - Cannot attenuate back to Wildcard
- Depth limit - MAX_DELEGATION_DEPTH (64) enforced
- Terminal warrants - Cannot delegate further (max_depth=0)
- Issuer/Execution separation - Each type has distinct capabilities
- Default inclusion - Default parameter values always checked
- Complete extraction - All parameters extracted automatically
- Fail-closed - Extraction failures deny authorization
These are documented by @pytest.mark.integration_responsibility tests:
- Wrapper usage - Must call
warrant.authorize() - Root trust - Must use Authorizer with trusted_roots
- Path canonicalization - Must resolve
..before authorization - Node coverage - Must wrap ALL nodes in LangGraph
- Nonce/idempotency - App-level for replay prevention
Found an attac scenario we missed? Please:
- Open an issue with
[SECURITY]prefix - Or submit a PR with a failing test
See SECURITY.md for responsible disclosure.
- Most tests should PASS (attacks are blocked by Tenuo)
integration_responsibilitytests document app-level concerns- Info messages explain expected behavior or limitations
- Create test in appropriate category file
- Add
@pytest.mark.securityand category marker - Print attack description and result
- Use
pytest.raises()for expected failures - Document in this README
Some attacks require binary manipulation and are tested at the Rust level:
- ChainLink tampering -
tenuo-core/tests/red_team.rs - CBOR payload tampering -
tenuo-core/tests/red_team.rs
See tenuo-core/tests/red_team.rs for those tests.