Skip to content

fix(decisioning): strip permitted_billing leak from INVALID_BILLING_MODEL details#399

Closed
bokelley wants to merge 2 commits intomainfrom
bokelley/issue-375-billing-leak
Closed

fix(decisioning): strip permitted_billing leak from INVALID_BILLING_MODEL details#399
bokelley wants to merge 2 commits intomainfrom
bokelley/issue-375-billing-leak

Conversation

@bokelley
Copy link
Copy Markdown
Contributor

@bokelley bokelley commented May 3, 2026

Summary

  • Strip details.permitted_billing and the enumerated modes from the human message in validate_billing_for_agent. The AdCP billing-not-permitted-for-agent details schema forbids carrying the agent's full permitted-billing subset on the wire — the recognized caller already knows its own capabilities, structured echo is non-conformant.
  • Update the validate_billing_rejects_passthrough_only_with_agent_billing test to assert the leak is gone (no permitted_billing key, no ['operator'] rendering, no "permitted modes" phrasing).

Scope

This is the partial fix (Path A) from #375 — the one-line spec-leak fix that's independent of the larger code-rename question. It is not breaking for adopters that aren't reading details.permitted_billing.

The full code rename (AGENT_SUSPENDED / AGENT_BLOCKED / REQUEST_AUTH_UNRECOGNIZED_AGENT / INVALID_BILLING_MODEL → spec-conformant codes) is deferred behind AdCP v3.1, which needs to add AGENT_SUSPENDED / AGENT_BLOCKED / BILLING_NOT_PERMITTED_FOR_AGENT to the error vocabulary with proper recovery semantics before the SDK can switch. Issue #375 is labeled v3.1 to track that follow-up.

Test plan

  • validate_billing_rejects_passthrough_only_with_agent_billing updated and verified manually (conftest broken on this workspace from a2a-sdk migration; ran the assertions directly against the function — all pass)
  • validate_billing_rejects_advertiser_when_not_in_capabilities still passes (only checks code and message-contains-"advertiser")
  • validate_billing_accepts_permitted_modes still passes
  • ruff check clean
  • mypy src/adcp/ clean

Refs #375

🤖 Generated with Claude Code

…ODEL details

The billing-not-permitted-for-agent details schema forbids carrying the
agent's full permitted-billing subset on the wire. Drop the field from
`details` and remove the enumerated modes from the human message; the
recognized caller already knows its own capabilities.

Partial fix for #375 — the code-rename portion (AGENT_SUSPENDED /
AGENT_BLOCKED / REQUEST_AUTH_UNRECOGNIZED_AGENT / INVALID_BILLING_MODEL
→ spec-conformant codes) is deferred behind v3.1 of the AdCP spec,
which needs to add AGENT_SUSPENDED/AGENT_BLOCKED/BILLING_NOT_PERMITTED
codes with proper recovery semantics before the SDK can switch.

Refs #375

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…lling-leak

# Conflicts:
#	src/adcp/decisioning/registry.py
#	tests/test_buyer_agent_registry.py
@bokelley
Copy link
Copy Markdown
Contributor Author

bokelley commented May 3, 2026

Superseded by #393, which landed on main with the comprehensive Path A + Path C fix (full rename to BILLING_NOT_PERMITTED_FOR_AGENT with recovery="correctable", details.rejected_billing + optional details.suggested_billing, no agent_url in details). After merging origin/main into this branch, the content delta is empty.

Closing #375 follow-ups landed in #393.

@bokelley bokelley closed this May 3, 2026
@bokelley
Copy link
Copy Markdown
Contributor Author

bokelley commented May 3, 2026

Acknowledged — #393 landed the comprehensive Path A + Path C fix, making this PR's delta empty. Nothing further to action here.


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant