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

# Platform agent

> Build agents and workflows from chat in the Keystroke web app.

The platform agent is Keystroke's built-in building agent. Open a chat in the web app, describe the agent, workflow, or automation you want, and it builds it — writing real TypeScript in your project, connecting integrations, testing what it built, and deploying when you're ready. No IDE, CLI install, or repo on your machine.

It is one of three ways to build with AI on Keystroke:

| Surface                                             | Where you work                              | Best for                                                                |
| --------------------------------------------------- | ------------------------------------------- | ----------------------------------------------------------------------- |
| **Platform agent** (this page)                      | Chat in the Keystroke web app               | Building from the browser; teammates without a local dev setup          |
| **[CLI for agents](/docs/build-with-ai/cli-for-agents)** | Your own editor (Cursor, Claude Code, etc.) | Full control of files, git, tests, and editor tooling                   |
| **[MCP for agents](/docs/build-with-ai/mcp-for-agents)** | An external chat agent (ChatGPT, Claude)    | Connecting Keystroke to an agent you already use, with no local install |

All three edit the same project source and deploy to the same platform, so you can move between them freely — start something in the app, refine it from your editor, or vice versa.

## Start a chat

Open **New chat** in the sidebar, or use the chat dock at the bottom of the workspace. Each chat session is bound to one project in your active organization — to work on a different project, start a chat there.

Describe the outcome you want rather than choosing a primitive up front, the same way you would prompt a coding agent:

```
Each weekday morning, scan my Google Calendar, Gmail inbox, and Linear issues, then send me a short briefing in Slack.
```

The platform agent inspects your project's existing code, reads these docs as it works, and asks before consequential choices.

## How it works

Behind the chat, the platform agent works in a hosted session with the `keystroke` CLI and a checkout of your project's managed Git repository — the same source a coding agent edits locally.

* **It edits the shared draft.** Every project repository has two branches: `main` holds the deployed, live state, and `ks/draft` is the shared work-in-progress draft. The platform agent commits and pushes to `ks/draft`. Teammates and their sessions share the same draft.
* **The web app renders the deployed state.** Workflow canvases, agent pages, and run history show what's live. Draft edits appear in the project's **Repository** tab (which tracks the draft in real time) until they're deployed.
* **Deploying promotes the draft.** When the agent runs `keystroke deploy`, the draft is built, health-checked, and promoted to `main` and the live runtime. Until then, changes exist only on the draft.
* **It's already authenticated.** Sessions carry your project's API credentials. The platform agent never asks you to log in and never runs `keystroke auth login`.

When it finishes building or changing something, it links the resource so you can open it directly in the app.

## Connect integrations from chat

When a build needs an app connection (Slack, Google, Linear, an API key), the platform agent shares a connect link. Opening it launches the in-app connect dialog, where you approve OAuth or enter the key and choose the scope. The agent then verifies the connection and continues.

Secrets never pass through the chat — you enter them in the connect flow, and they're stored as [credentials](/docs/learn/credentials/overview) like any other connection.

## Working alongside coding agents

The platform agent and coding agents are collaborators on the same project, not alternatives you must choose between once:

* A coding agent working locally picks up platform-agent edits with `keystroke pull` (which fetches the shared draft) and publishes its own work through `keystroke deploy`.
* The platform agent sees local work as soon as it's deployed or on the draft.
* Everything either one builds is ordinary TypeScript in the project — reviewable, testable, and maintainable by the other.

For editor-based workflows, see [CLI for agents](/docs/build-with-ai/cli-for-agents). For a walkthrough of the local setup, see the [Quickstart](/docs/quickstart).

## If you are an agent reading this in a hosted session

Reading this from inside a Keystroke-hosted session (the platform agent, or an MCP workspace)? The local-setup docs don't apply to you:

* You are already authenticated — never run `keystroke auth login`, and skip install/`keystroke init`/`projects link` bootstrap steps.
* Your checkout is the shared draft (`ks/draft`). Run `keystroke typecheck` before committing, and push with `git push origin HEAD:ks/draft` — a broken shared draft affects everyone.
* You cannot open a browser. For app connections, run `keystroke connect <slug> --print-url` and share the printed URL with the user.
* Draft edits are not live until `keystroke deploy` promotes them — say so when you finish without deploying.

## Next steps

<CardGroup cols={2}>
  <Card title="CLI for agents" href="/docs/build-with-ai/cli-for-agents">
    The local editor path: headless CLI, JSON output, deploy-first loop.
  </Card>

  <Card title="MCP for agents" href="/docs/build-with-ai/mcp-for-agents">
    Build from ChatGPT, Claude, or any MCP client in a hosted workspace.
  </Card>

  <Card title="Deploy a project" href="/docs/learn/projects/deploy-a-project">
    The draft/main model and what deploy actually does.
  </Card>

  <Card title="Connect credentials" href="/docs/learn/credentials/connect-credentials">
    Connect apps, API keys, and OAuth accounts.
  </Card>
</CardGroup>
