Agent-side credential store + fetch (agent-owned, real cred worker)#228
Agent-side credential store + fetch (agent-owned, real cred worker)#228joker4002 wants to merge 4 commits into
Conversation
… cred test; runbook sync - sandbox-agent-isolation.sh: resolve + export AGENTKEYS_SESSION_BEARER BEFORE the memory roundtrip, not just cred. Both paths cap-mint AS the agent, so the broker's omni_account-vs-operator_omni check fails the FIRST (memory) roundtrip when the bearer is absent. Keep an already-set env bearer to avoid regressing setups that provide it directly. - three_acts.rs: add agent_owned_cred_store_rejects_cross_actor_param — the MCP per-actor gate (check_actor_param) refuses a cross-actor cred.store and mints no cap. - operator-runbook-harness.md: note the sandbox proof now covers memory + cred.
|
Pushed 1. Sandbox bearer ordering (the real blocker). 2. Negative test. Added 3. Runbook sync. Scope — retitled to drop "provisioning". This PR ships agent-owned store/fetch; the agent-email → service-signup → store provisioning half of #198 is not here. The body says "Source issue" (not "Closes"), so merge won't auto-close #198 — leaving it open for the provisioning follow-up. Note #198 and #199 are duplicates of the same work; worth closing one. Deliberately not changed: |
…ed tools reach the worker
The MCP server advertised agentkeys.cred.{store,fetch} but built its BackendClient
with cred_url=None, so every real (non-mock) call failed with
NotConfigured("cred_url") before reaching the deployed cred worker (cred.<zone>:9094).
Unit tests missed it because MockBackend bypasses BackendClient.
- config.rs: add cred_url (--cred-url / env AGENTKEYS_CRED_URL), mirroring memory_url.
- main.rs: pass config.cred_url; extract build_http_backend + a unit test asserting
every worker URL (incl. cred_url) flows from config, so a hardcoded None can't
silently return — the gap a MockBackend test cannot catch.
- phase1-wire-demo.sh: launch the sandbox MCP with --cred-url $AGENTKEYS_WORKER_CRED_URL.
- setup-mcp-host.sh: add AGENTKEYS_CRED_URL to the hosted MCP env (both modes).
|
Codex adversarial review follow-up — pushed Finding #1 [critical] — FIXED. Confirmed real: the MCP server advertised
Finding #2 [high] — real but pre-existing & repo-wide; deferring to a follow-up, not this PR. The cred-fetch handler audits only via |
The cred_url field doc still framed it as litentry#216 fetch-only ("no cred-fetch available"); this PR makes it back /v1/cred/{store,fetch} (the protocol.rs section header was already updated). No code change — comment only. Verified the rest of the PR carries no dead code: cargo clippy -D warnings across agentkeys-backend-client + agentkeys-cli + agentkeys-mcp-server is clean (the Input/Body + Resp/Result type pairs are the deliberate litentry#203 wire/API split that the memory + config paths also follow, not redundancy).
Change:
Objective Evidence:
cargo fmt --all -- --check;cargo check -p agentkeys-cli --bin agentkeys;cargo test -p agentkeys-backend-client -p agentkeys-mcp-server -p agentkeys-cli --lib;cargo test -p agentkeys-mcp-server --test three_acts --test http_auth;bash -n harness/scripts/sandbox-agent-isolation.sh;bash scripts/check-backend-fixture-drift.sh;git diff --check.Visual Evidence:
Reviewer:
Risks / Not Covered: