Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/docs/content/docs/(index)/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"getting-started",
"full-stack-tutorial",
"prisma-compute/deploy",
"prisma-compute/agent-enrollment",
"---Prisma ORM---",
"...prisma-orm",
"---Prisma Postgres---",
Expand Down
59 changes: 59 additions & 0 deletions apps/docs/content/docs/(index)/prisma-compute/agent-enrollment.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
title: Enroll your agent
description: Give your coding agent its own Prisma credential with a permission policy, ask-to-act approvals, and a full audit trail — so it can build and deploy for you without borrowing your identity.
url: /prisma-compute/agent-enrollment
metaTitle: "Agent enrollment: give your AI agent its own Prisma credential"
metaDescription: Enroll a coding agent into your Prisma workspace with the OAuth device flow. The agent gets its own scoped credential and permission policy, sensitive actions pause for your approval, and every request is audited.
---

Your coding agent can already write a Prisma app. **Agent enrollment** lets it operate the platform too: create the workspace and database, connect the GitHub repository, and ship the first deployment — with its own credential, not yours.

You stay in control the whole time. Each agent enrolls through a pairing code you approve, acts under a permission policy you set, pauses on sensitive actions until you tap **Approve**, and leaves an audit trail of everything it did. When you're done with it, revoke it — one click, effective immediately.

![The Agents page in Prisma Console, listing four enrolled agents with their sponsors, permission policies, and statuses, plus two pending approval requests waiting for review.](/img/prisma-compute/agent-enrollment/agents-list.png)

## Why not just hand the agent your token?

Sharing your own credential with an agent means the agent *is* you: same access everywhere, no separate off-switch, and an audit log that can't tell you apart. Enrollment fixes all three:

- **Its own identity.** The agent's credential is issued to the agent, scoped by its policy, and revocable on its own — your access is never on the line.
- **Guardrails by default.** The default policy lets an agent read and build freely but **asks before production writes** and destructive actions. You can tighten or loosen this per agent, down to per-project overrides.
- **Accountability.** Every request an agent makes is logged under the agent's identity, with the credential that made it — visible in the workspace audit log and on the agent's own activity page.

## How enrollment works

Enrollment uses the OAuth device flow, the same pattern you know from signing in on a TV:

1. Your agent asks Prisma for a **pairing code** and shows it to you.
2. You open the approval page in Prisma Console, enter the code, and confirm — you're the agent's **sponsor**.
3. The agent receives a long-lived credential of its own (about 90 days) and stores it locally. From then on it works without any sign-in dance — across every workspace you belong to.

To set this up, open **Workspace settings → Agents → Enroll agent** in Console. It generates a ready-made instruction block — paste it into your project's `AGENTS.md` (or hand it to your agent directly), and any capable agent can take it from there: it enrolls itself, saves its credential to a gitignored file, and reuses it in every future session.

## Ask-to-act: approvals when it matters

When an agent attempts something its policy answers "ask" for — say, creating a database on a production branch — the request pauses, and an approval card appears in Console. You see who's asking, exactly what they're about to do, and the agent's one-line reason:

![An approval card showing that an agent wants to create a database, with operation and production-branch chips, the exact API request, the agent's stated reason, and Approve once, Approve for 1 hour, and Deny buttons.](/img/prisma-compute/agent-enrollment/approval-card.png)

Three responses cover the real situations:

- **Approve once** clears exactly this request. The agent's retry consumes the grant.
- **Approve for 1 hour** clears this *kind* of request — same operation on the same resource type — for an hour. When an agent is mid-flow and will legitimately repeat an action, one tap unblocks the whole run instead of six.
- **Deny** stops it, and the agent is told so.

The mechanics are built for how agents actually behave. The agent polls for your decision by itself — you never have to tell it "approved". If you're too slow and the request expires, your click still counts: expired requests stay approvable for a day, and the agent's retry picks the grant up automatically.

## A record of everything

Each agent's page shows its live activity and its full approval history: what it asked for, what you decided, and when the grant was used. Approvals that the agent consumed are marked, and every row expands to show the agent's reason and a precise timeline.

![The approval history table for an agent, showing requests with their targets and outcomes — approved with a consumption marker, approved for one hour, denied, and expired.](/img/prisma-compute/agent-enrollment/approval-history.png)

Pause an agent to freeze it without losing its history, or **revoke** it to kill every credential instantly and permanently.

## What an enrolled agent can do

Everything the platform offers, within its policy: create workspaces and projects, provision Prisma Postgres, connect a GitHub repository, and set up the [deploy-on-push workflow](/compute/deploy-on-push) — the API itself explains each next step to the agent as it goes, so a single prompt like *"build and deploy this app on Prisma"* runs end to end with you approving only the moments that matter.

To try it: [deploy your first app](/prisma-compute/deploy) yourself, or enroll your agent and have it done for you.
2 changes: 1 addition & 1 deletion apps/docs/content/docs/(index)/prisma-compute/deploy.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ A stage is a complete, isolated copy of the app: its own services, databases, an

## Hand it to your agent

You can let a coding agent do the work. Sign in once yourself ([step 2](#2-deploy)). The browser sign-in is the one step an agent can't do for you. After that, anything running in your environment inherits the session, including your agent. The `@prisma/composer` package ships an [agent skill](/cli/skills) that teaches your agent the installed version's API; [`npx prisma@latest init`](/cli/init) sets the project up so the skill stays in sync across upgrades. Paste this into your agent and fill in the blanks:
You can let a coding agent do the work. For an agent with its own credential, permission policy, and approval flow, see [Enroll your agent](/prisma-compute/agent-enrollment). For the simplest path, sign in once yourself ([step 2](#2-deploy)). The browser sign-in is the one step an agent can't do for you. After that, anything running in your environment inherits the session, including your agent. The `@prisma/composer` package ships an [agent skill](/cli/skills) that teaches your agent the installed version's API; [`npx prisma@latest init`](/cli/init) sets the project up so the skill stays in sync across upgrades. Paste this into your agent and fill in the blanks:

```text
Build [what you want] as a Prisma Composer app and deploy it to Prisma Compute using `npx prisma@latest`.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading