You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Akash console is becoming a programmatic deployment gateway — and agents are starting to hold wallets and pay for their own GPU leases (x402-style payments and USDC micropayments are live in the agent ecosystem). Today, nothing stands between "an agent decided to spend" and "the lease got created" except whatever budget config lives inside the agent itself.
Proposal
An optional, host-configured external spend-authority hook in the deployment/lease approval path: before creating a lease, the console consults a configured authority endpoint with a frozen spend request (caller, operation id, amount, currency, deployment facts) and proceeds only on an unambiguous allow.
Fail-closed: 2xx + {"decision":"allow"} proceeds; timeout, non-2xx, malformed verdict, or any ambiguity -> deny-as-unavailable. The only path to allow is an explicit verdict.
Replay protection: (caller_id, operation_id) so a retried request can't double-spend.
Would the team be open to an optional integration point here (env/config-gated, default off) so that operators running agent fleets on Akash can enforce external budgets without forking console? Happy to spec the request/response shape against the #525 contract if there's interest.
Thanks for the detailed write-up. I checked for existing coverage (spend gates, budget enforcement, lease approval, x402/agent payments) — no open issue covers this, so it's a new topic here.
Some grounding from the codebase, since it directly affects feasibility:
All console-sourced spend already flows through apps/api. deploy-web no longer supports browser-extension wallets — WalletProvider resolves only a managed wallet (apps/deploy-web/src/context/WalletProvider/WalletProvider.tsx:56) — and leases are composed and signed server-side: POST /v1/leases → LeaseService.#planCreation, which runs every refusal before anything is recorded or queued (apps/api/src/deployment/services/lease/lease.service.ts:126). So a host-side checkpoint in the api would genuinely cover every console spend, including API-key callers — the insertion point this proposal needs does exist.
The gates that exist today are all internal — none consult an external authority:
grant allowances, activation, trial caps and abuse locks in ManagedSignerService's pre-broadcast checks (apps/api/src/billing/services/managed-signer/managed-signer.service.ts:177)
tx-signer's TxPolicyService as the last line: per-message actor bindings (including MsgCreateLease) and rejection of grants without finite spend limits (apps/tx-signer/src/services/tx-policy/tx-policy.service.ts:28)
The building blocks for an outbound authority call also exist: ExternalSignerHttpSdkService (typed HTTP client with api-key + timeout) and ProviderOutagesHttpService (fetch + zod-parsed response) are the two templates, and fail-closed matches house style (requireInternalToken already fails closed when unset).
What would need deciding before this is spec-able:
Tenancy model — console is a multi-tenant service; an env-configured authority endpoint would gate every user of that deployment. Is the intended model operators self-hosting console for their agent fleets, or per-org/per-user authority configuration on the hosted service?
Scope of "spend" — lease creation only, or every spend message (deployment-create deposit, top-ups, /v1/tx)? The budget gate today covers deposits at both create and top-up; the same boundary question applies to an external gate.
Deny surface — a new error code alongside project_budget_exceeded, for both API-key callers and the web UI?
Receipts — where signed verdicts and the hash chain would live, who distributes/rotates the Ed25519 verification keys, and what retention is expected?
Items 1 and 2 are the ones that determine whether this is a small middleware or a larger configuration surface.
Answering the four questions in order — items 1 and 2 first, since they set the shape.
1. Tenancy model: operator-level, self-hosted fleets. The authority endpoint is operator configuration, in the same spirit as the existing internal gates (requireInternalToken already fails closed when unset — same pattern, one more consult). Console changes nothing per-user: the operator points a deployment at an authority, and every spend intent from that deployment is gated. Per-org/per-user authority routing on the hosted service is a future layer; it does not need console changes because the verdict carries the subject, so different fleets can sit behind different authorities without this codebase caring.
2. Scope of spend: lease creation first, then the existing budget boundary. Start with LeaseService.#planCreation — the highest-value, hardest-to-un-serve operation, and the one where serving-first leaves the operator exposed. Once that is proven, extend to the boundary assertWithinBudgets already covers (deposits at create and top-up) and /v1/tx via TxPolicyService as the last line. Principle: gate where the internal gates already live, so there is one policy boundary, not two competing ones. This is the small-middleware path.
3. Deny surface: a dedicated code, structured reason, no upstream leakage. New error alongside project_budget_exceeded (e.g. spend_authority_denied), surfaced to both API-key callers and the web UI. The verdict's deny reason and verdict id go out as structured detail; the authority's URL, errors and internals never leave the server logs. Timeout, malformed response, non-2xx and an explicit deny are all the same outcome: fail closed, with authority_unavailable distinguishable from denied only in the operator-facing logs.
4. Receipts: signed verdicts, operator-pinned key, no PII egress. Verdicts are Ed25519 signatures over the RFC 8785 JCS canonical form, scope-bound to {challenge, resource, amount_usd} (RFC-ATC §5.2 rev 4 — hardened through public review, incl. a seller-side premise check on sub-cent pricing). The challenge is console-minted and one-time, so replay dies with no operator-side state. Verification key is pinned in console config; verdicts carry a key id for rotation. Retention sits with the existing lease audit trail; what leaves the deployment is spend-intent metadata only (resource, amount, agent subject) — no user PII. Reference implementation, MIT: https://github.com/alicelabs-llc/universal-trust-adapter
Activity
pullfrog commentedon Oct 22, 2026
Thanks for the detailed write-up. I checked for existing coverage (spend gates, budget enforcement, lease approval, x402/agent payments) — no open issue covers this, so it's a new topic here.
Some grounding from the codebase, since it directly affects feasibility:
All console-sourced spend already flows through
apps/api. deploy-web no longer supports browser-extension wallets —WalletProviderresolves only a managed wallet (apps/deploy-web/src/context/WalletProvider/WalletProvider.tsx:56) — and leases are composed and signed server-side:POST /v1/leases→LeaseService.#planCreation, which runs every refusal before anything is recorded or queued (apps/api/src/deployment/services/lease/lease.service.ts:126). So a host-side checkpoint in the api would genuinely cover every console spend, including API-key callers — the insertion point this proposal needs does exist.The gates that exist today are all internal — none consult an external authority:
assertWithinBudgets→ 403project_budget_exceeded(apps/api/src/billing/services/deployment-deposit-ledger/deployment-deposit-ledger.service.ts:133)ManagedSignerService's pre-broadcast checks (apps/api/src/billing/services/managed-signer/managed-signer.service.ts:177)TxPolicyServiceas the last line: per-message actor bindings (includingMsgCreateLease) and rejection of grants without finite spend limits (apps/tx-signer/src/services/tx-policy/tx-policy.service.ts:28)The building blocks for an outbound authority call also exist:
ExternalSignerHttpSdkService(typed HTTP client with api-key + timeout) andProviderOutagesHttpService(fetch + zod-parsed response) are the two templates, and fail-closed matches house style (requireInternalTokenalready fails closed when unset).What would need deciding before this is spec-able:
/v1/tx)? The budget gate today covers deposits at both create and top-up; the same boundary question applies to an external gate.project_budget_exceeded, for both API-key callers and the web UI?Items 1 and 2 are the ones that determine whether this is a small middleware or a larger configuration surface.
GLM-5.3| 𝕏eddyflores100-lang commentedon Oct 22, 2026
Answering the four questions in order — items 1 and 2 first, since they set the shape.
1. Tenancy model: operator-level, self-hosted fleets. The authority endpoint is operator configuration, in the same spirit as the existing internal gates (
requireInternalTokenalready fails closed when unset — same pattern, one more consult). Console changes nothing per-user: the operator points a deployment at an authority, and every spend intent from that deployment is gated. Per-org/per-user authority routing on the hosted service is a future layer; it does not need console changes because the verdict carries the subject, so different fleets can sit behind different authorities without this codebase caring.2. Scope of spend: lease creation first, then the existing budget boundary. Start with
LeaseService.#planCreation— the highest-value, hardest-to-un-serve operation, and the one where serving-first leaves the operator exposed. Once that is proven, extend to the boundaryassertWithinBudgetsalready covers (deposits at create and top-up) and/v1/txviaTxPolicyServiceas the last line. Principle: gate where the internal gates already live, so there is one policy boundary, not two competing ones. This is the small-middleware path.3. Deny surface: a dedicated code, structured reason, no upstream leakage. New error alongside
project_budget_exceeded(e.g.spend_authority_denied), surfaced to both API-key callers and the web UI. The verdict's deny reason and verdict id go out as structured detail; the authority's URL, errors and internals never leave the server logs. Timeout, malformed response, non-2xx and an explicitdenyare all the same outcome: fail closed, withauthority_unavailabledistinguishable fromdeniedonly in the operator-facing logs.4. Receipts: signed verdicts, operator-pinned key, no PII egress. Verdicts are Ed25519 signatures over the RFC 8785 JCS canonical form, scope-bound to
{challenge, resource, amount_usd}(RFC-ATC §5.2 rev 4 — hardened through public review, incl. a seller-side premise check on sub-cent pricing). The challenge is console-minted and one-time, so replay dies with no operator-side state. Verification key is pinned in console config; verdicts carry a key id for rotation. Retention sits with the existing lease audit trail; what leaves the deployment is spend-intent metadata only (resource, amount, agent subject) — no user PII. Reference implementation, MIT: https://github.com/alicelabs-llc/universal-trust-adapter