Add per-session credential read rate limiting#192
Open
crossagent-production-app[bot] wants to merge 1 commit into
Open
Add per-session credential read rate limiting#192crossagent-production-app[bot] wants to merge 1 commit into
crossagent-production-app[bot] wants to merge 1 commit into
Conversation
Author
Delivery Evidence SummaryChange:
Objective Evidence:
Visual Evidence:
Reviewer:
Risks / Not Covered:
Generated at: 2026-06-04T12:16:03.919Z |
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.
Fixes #4
Adds a v0 mock credential-read token bucket per session with default 100 reads/minute and a hard cap of 10,000 reads/minute for creation-time overrides. Excess reads return structured rate_limit_exceeded errors with retry_after_secs and emit audit_events rows that agentkeys usage can display. CLI read now surfaces RATE_LIMIT clearly, agentkeys run retries temporary rate limits up to 3 times, and the daemon MCP wrapper returns structured JSON-RPC error data while recording a local audit line.
Verification:
Change:
Objective Evidence:
cargo check -p agentkeys-mock-server -p agentkeys-core -p agentkeys-cli -p agentkeys-mcppassed.cargo test -p agentkeys-mock-server credential_rate_limit -- --nocapturepassed: 5 tests.cargo test -p agentkeys-cli cmd_run -- --nocapturepassed: 7 tests.cargo test -p agentkeys-daemon mcp_get_credential -- --nocapturepassed: 2 tests.Visual Evidence:
Reviewer:
Risks / Not Covered: