Skip to content

broker: per-user balance privacy fix + io.pilot.orthogonal v0.1.1#72

Merged
Alexgodoroja merged 2 commits into
mainfrom
fix/orthogonal-balance-privacy
Jul 7, 2026
Merged

broker: per-user balance privacy fix + io.pilot.orthogonal v0.1.1#72
Alexgodoroja merged 2 commits into
mainfrom
fix/orthogonal-balance-privacy

Conversation

@Alexgodoroja

Copy link
Copy Markdown
Collaborator

Problem

A user flagged that orthogonal.balance returned the entire shared account's credit balance — every pilot user's pooled spend on the master orth_live_ key. A shared-master-key app must never expose the account-wide balance.

Fix (broker, server-side — protects every already-installed adapter)

  • New CreditSpec.balance_path: the broker answers that path from its own per-caller ledger and never forwards it upstream, returning only the caller's remaining micro-$ budget ("$X.XX" + credits_remaining + credits_seed, scope: per-pilot-user). Seeds on first sight so the per-IP cap applies.
  • Operators keep the partner's real account balance/usage/ledger paths out of the allow-list so they can't be proxied. The io.pilot.orthogonal broker entry now allows only search/details/integrate/list-endpoints/run, with balance_path: /v1/credits/balance.
  • Already deployed to the shared broker (broker.pilotprotocol.network) and live-verified.

App v0.1.1 (surface matches reality)

  • orthogonal.balance description → your per-user budget (not the account).
  • Removed orthogonal.check / .transactions / .usage (account-wide; the broker now 403s them).
  • Long description clarifies you only ever see your own budget.

Verified live (real master key)

  • orthogonal.balance$5.00 per-user (was $54 account); account balance never exposed.
  • usage/transactions/check403.
  • Billable run debits the per-user budget; depleted user → 402 (upstream not charged); free discovery still works.
  • Per-IP cap: 6th identity from one IP → 429.
  • New broker tests: TestCreditBalance_PerUserNotAccount (+ existing respcost/IP-cap tests) green; verify-submission builds 4 platforms for v0.1.1.

🤖 Generated with Claude Code

Alex Godo and others added 2 commits July 7, 2026 14:28
…balance

A shared-master-key (credit) app whose partner exposes an account-wide balance/
credits endpoint would leak the WHOLE pooled account balance (every user's spend)
to any single caller. Add CreditSpec.balance_path: the broker answers that path
from its OWN per-caller ledger and never forwards it, returning only the caller's
remaining micro-$ budget ("$X.XX" + credits_remaining). Seeds on first sight so
the per-IP cap applies. Operators keep the partner's real account-balance/usage/
transactions paths OUT of the allow-list so they can't be proxied.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…de methods

The broker now answers orthogonal.balance from its own per-user ledger and blocks
the partner's account-wide credit endpoints. Update the app surface to match:
- orthogonal.balance description → YOUR per-user budget (not the shared account).
- remove orthogonal.check / .transactions / .usage (account-wide; broker 403s them).
- long description: clarify you only ever see your own budget, never the pooled total.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Alexgodoroja Alexgodoroja merged commit 64b3b5b into main Jul 7, 2026
7 checks passed
@TeoSlayer TeoSlayer deleted the fix/orthogonal-balance-privacy branch July 13, 2026 07:53
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