> ## Documentation Index
> Fetch the complete documentation index at: https://mcp.shipcontent.com/llms.txt
> Use this file to discover all available pages before exploring further.

---
title: Agent access
description: Connect one agent client to all your workspaces and control its Publish permission and spending budget.
section: contracts
order: 20
status: implemented
mode: both
reviewed: 2026-11-27
sources: [src/lib/mcp/agent-spending-budget-definitions.ts, src/lib/billing/spending-budget.ts, db/accounts.sql, src/components/owner/agent-budget-editor.tsx, src/components/owner/agent-permission-rows.tsx, db/billing.sql, db/media.sql, db/tiktok.sql, src/lib/server/database/AppDatabase.ts, src/components/owner/owner-onboarding.tsx, src/lib/mcp-surface.ts, src/lib/server/auth/README.md, src/lib/server/auth/PrincipalResolver.ts, src/lib/mcp/agent-tools.ts, src/lib/server/mcp/AgentMcp.ts, src/lib/instagram/auto-publish.ts, src/lib/server/owner/OwnerHandler.ts, src/components/owner/publish-consent.tsx, src/components/owner/agent-access.tsx, src/lib/server/billing/retention-delete-sender.ts, src/lib/auth/access.ts]
tools: [set_spending_budget, get_credit_balance, list_workspaces, start_media_upload, propose_generation, publish_instagram_reel, get_onboarding_status]
next: [/docs/contracts/request-ids]
---
OAuth proves the client identity. One account grant connects that exact client to all workspaces of the owner, including new ones. `list_workspaces` returns every owned workspace and `access.canPublish`. Every other tool keeps an explicit `workspaceId` and checks current ownership and the same account grant again.

## Connect an agent

At `/oauth/consent`, the owner selects **Allow** once for the account. There is no workspace picker. Updated 2026-11-07: an active grant shows the agent name and its connection date on `/agent-access` and each workspace's Agents page. A second **Allow** keeps the same active grant; it does not replace the grant. Consent saves the new Publish choice.

A connected agent can read, update business details and prepare drafts in all owned workspaces. By default publication, scheduling, file uploads and spend need owner approval. The consent states: "It can read and draft in all your workspaces, including new ones. It cannot publish, schedule, spend or upload files without your approval."

## Publish permission

Updated 2026-11-07: at consent, the owner can select the box **Let this agent publish, schedule and upload posts on all your social channels without asking.** Later, in Agents or `/agent-access`, the owner selects **Allow** in the agent's **Publish social posts** row. The same box shows there, already selected. Enabling Publish requires typing `allow agent`, with the same letter case, then **Allow**. Spaces before and after are ignored. The browser and server both check this confirmation.

Publish covers this agent's active account grant, all owned workspaces and all channels. There are no per-account automatic publishing controls or ShipContent daily publishing limits. Provider limits still apply. `list_workspaces.access.canPublish` reports the current permission.

An `automatic` post can be published by this agent without owner review. A `review` post still needs the owner; an agent cannot change an owner's review choice (`PUBLISH_MODE_LOCKED`). Publish also permits supported schedules and direct uploads of an MP4, a JPEG or a PNG. Publish grants no spending authority. Eligible media generation and renders can use a separate spending budget for images and videos. Advertising execution, TikTok comment replies and provider account authorization still need the owner. Operator flags, YouTube privacy restrictions and provider limits remain in force.

## Spending budget

Updated 2026-11-07: "spending budget" is the budget for image and video credits only, never publishing. The spending budget is off for each new grant. It needs no feature flag and no Publish permission. The budget covers one agent grant across all owned workspaces. Each agent can read or change only its own budget.

In **Agents** or `/agent-access`, find the **Generate images and videos** row. Select **Set budget**, choose an amount from 1 to 1,000,000 credits or **No limit**, then select **Save**. No typed confirmation is needed. **Change** edits the budget. When no credits are left, the button is **Raise budget**. The other row is **Publish social posts**. An agent can call `set_spending_budget` only after it explains the amount and effect and the owner tells it to do so. Its `budgetCredits` input is a string: `"0"` turns the spending budget off, `"1"` through `"1000000"` sets credits, and `"unlimited"` sets No limit.

The spending budget lets this agent spend up to the budget without asking. You are responsible for these charges.

The spending budget uses only credits already in the account; it never triggers auto-refill.

No limit lets the agent spend every credit in the account on images and videos. It stops when the balance runs out. On an account with unlimited credits, or in billing mode `shadow`, the balance is not checked, so No limit has no credit ceiling. Account access, the queue and the ten-job workspace limit still apply. A credit exemption keeps plan limits. A billing enforcement bypass does not. See [billing](/docs/workflows/billing). The `set_spending_budget` result has a `notice` that states which case applies to the account.

This is a fixed total from the time the spending budget was last turned on, not an allowance per call or per month. Changing a positive budget keeps that start time and usage. This includes a change between an amount and No limit. Used credits count from that start time with No limit too. Turning it off and on starts a new period. Held and unknown reservations count at their reserved amount; committed reservations count at their final amount. Released reservations count as zero. Remaining credits cannot be negative. Lowering the budget below usage leaves no remaining allowance.

`get_credit_balance.spendingBudget` returns `enabled`, `budgetCredits`, `usedCredits`, `leftCredits` and `since`. Credit amounts are decimal strings. `budgetCredits` is `"unlimited"` for No limit, and then `leftCredits` is `null`. `since` is null when disabled. This read exposes no other agent's budget. The owner sees the remaining and total credits with a meter of the used credits, or the used credits for No limit. **Budget history** shows the ten latest budget changes, including who made each change.

`propose_generation`, `propose_render`, `export_project` and `prepare_seedance_reference` can queue new jobs within the budget. The whole new batch must fit. Otherwise the new jobs wait for owner approval without new holds. `askOwner: true` requests approval for new jobs. Replaying a request preserves its saved jobs, even after a budget or `askOwner` change. Read `requiresOwner` and the saved job status; see [media decisions](/docs/workflows/media#propose-generated-media).

Billing mode `off` falls back to approval with `BILLING_OFF` because no holds can count against the budget. Ordinary `enforce` accounts must have available credits; with too few, new jobs wait for the owner with `NO_CREDITS`. A billing enforcement bypass does not wait on `NO_CREDITS`. Shadow mode and internal exempt accounts keep their existing billing policies; their agent holds still count against the budget. With No limit, the budget check is skipped, but the ten-job workspace limit and replay rules still apply. Other access and queue checks remain in force. See the No limit note above for plan limits.

**Turn off** in the **Generate images and videos** row stops new spending and keeps queued jobs. **Disconnect** also cancels eligible unsent agent jobs and releases their holds. It cannot stop generation submission or native render execution that already started. Owner-approved jobs keep their existing state. A new connection starts with the spending budget off.

## Turn off publishing or disconnect

Updated 2026-11-07: **Turn off** in the **Publish social posts** row stops new agent publication, scheduling and direct upload actions. It keeps the connection and all queued and scheduled work. Review fallback returns `mode: "owner_review"` and `reason: "publish_off"`; give the returned owner URL to the owner.

**Disconnect** revokes the account grant, deletes that client's saved OAuth consent and cancels unsent agent work in all workspaces. It does not undo a provider request that already started or remove a published post. A later connection creates a new grant; the old grant and old operations cannot regain authority.

## Account access

Grants have no end date. Calls also require current account access.

Updated 2026-11-04. The hosted service uses billing mode `enforce`. A new account chooses Free or Pro before new work, except an owner on the billing enforcement bypass. See [Billing](/docs/workflows/billing). With `enforce`, the end of Free, the end of a paid plan and zero credits do not end account access. Plan limits and credits stay separate from that access rule.

An operator can run a server with billing mode `off` (the default) or `shadow`. These modes do not apply to the hosted service. On such a server, a new account has access until one year after sign-up. A paid period can extend access. When the later period ends, owner, agent and worker access stop together with `ACCESS_ENDED`. Signing in again does not extend access. Renewal restores active grants; it does not restore a disconnected client.

An operator suspension ends access in every mode. The operator must end the suspension before the account can regain access.

Updated 2026-10-17: access expiry does not authorize file deletion. The former access-end cleanup rule is retired in every billing mode. The session reports `filesDeleteAfter: null`; the owner notice does not derive a deletion date from trial or paid access. A suspension reports `suspended: true` and does not authorize deletion. File cleanup defaults to paused during the billing rollout. The separate never-paid retention protocol is not enabled.

Updated 2026-10-17: the runtime no longer has an hourly access-expiry sweep or a storage method that deletes a live workspace prefix. Retention uses captured object identities and the maintenance queue. Its cleanup flag and proof checks remain required.

Checks use the current time after database waits. A cached principal cannot preserve expired authority. Protected reads and writes check access before returning or committing. Paid media jobs already submitted can collect their saved result; renewal does not submit them again.

Updated 2026-10-17: `get_credit_balance` and `get_credit_prices` need a current workspace grant. They expose no payment session creation or paid approval. Agent credit history and cursors are redacted. Token expiry, refresh rotation, current membership and grant revocation still apply; Publish permission does not bypass owner billing authentication.
