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

# How Vendo works

> A question goes in, your own API does the work, a screen comes back.

## The picture

Every request walks the same five boxes, in the same order.

```mermaid theme={null}
flowchart LR
  U["<b>Your user</b><br/>asks in plain language"]
  S["<b>Vendo surface</b><br/>sandboxed, in your brand"]
  A["<b>Agent</b><br/>picks tools from tools.json"]
  G["<b>Guard</b><br/>risk · approval · audit"]
  P["<b>Your API</b><br/>your routes, your auth"]

  U --> S --> A --> G --> P
  P -. "generated UI" .-> U

  classDef yours fill:#ffffff,stroke:#c9c5d6,stroke-width:1px,color:#15141b
  classDef vendo fill:#f5f1ff,stroke:#ddd0ff,stroke-width:1px,color:#4a22bd
  class U,P yours
  class S,A,G vendo
```

Three boxes are Vendo. The two on the ends are yours.

<Note>
  Vendo Cloud runs the managed pieces behind those boxes: the hosted store, model gateway, sandbox, and broker.
</Note>

## One request, end to end

The same five boxes, with one real turn moving through them. A user types
*"show me what I spent on travel last quarter."*

<Steps>
  <Step title="The surface posts the question">
    The panel sends it to a route inside **your own app** — the one file `vendo init`
    wrote. It does not go to Vendo's servers.
  </Step>

  <Step title="Your route says who is asking">
    Your own auth resolves the signed-in user. A visitor your resolver cannot place
    is refused the turn.
  </Step>

  <Step title="The agent picks a tool">
    It reads `.vendo/tools.json` and chooses `host_transactions_list` with a date
    range. The prompt carries your instructions, your theme and knowledge index, the
    user's messages, and the tool schemas — which model answers it, and whose
    servers it runs on, is set by
    [your model credential](/production/model-credentials).
  </Step>

  <Step title="The guard grades the call">
    A read like this one runs. Anything destructive, and anything extraction could
    not grade, stops and parks the turn on an approval card showing the exact
    request. Approve it and the same turn resumes.
  </Step>

  <Step title="Your API runs the call">
    The call reaches your own endpoint as the person who is signed in. The agent can
    do what that person could already do by clicking, and nothing more.
  </Step>

  <Step title="A screen comes back instead of a paragraph">
    The agent calls `vendo_make`. The screen's code runs in a WebAssembly VM that
    can't touch anything — no DOM, no network, no clock — and your surface renders
    what comes out, in your brand, bound to the rows your own API just returned.
  </Step>
</Steps>

## What runs where

Your repo, your API, and your auth stay on your side. Vendo Cloud runs the managed pieces.

<Columns cols={2}>
  <Card title="Your machine, your infra" icon="folder">
    Never leaves your side.

    * your repo and code
    * `.vendo/`
    * your API and routes
    * your auth
  </Card>

  <Card title="Vendo Cloud" icon="cloud">
    The pieces Vendo runs for you.

    * hosted store
    * model gateway
    * sandbox
    * broker
    * sharing
  </Card>
</Columns>

### The questions everyone asks

<AccordionGroup>
  <Accordion title="Who calls my API?" defaultOpen>
    Your own server does. Every tool call runs inside your process, through the route `init` wired. Vendo's servers never call your API and never hold your users' credentials.
  </Accordion>

  <Accordion title="Whose identity is on those calls?" defaultOpen>
    The signed-in user's own headers, forwarded only to the API origin you configured. For unattended runs, a short-lived token your server mints from your own secret, naming the user who set the automation up.
  </Accordion>

  <Accordion title="Where do prompts go?" defaultOpen>
    Wherever your composition points them. Select a model object — `models: { default: anthropic("claude-sonnet-4-6") }`, which is what `vendo init` writes when you bring your own key — and the prompt goes straight to that provider. Vendo's servers never see it. Leave the slot unset and the `VENDO_API_KEY` in your environment answers it over Vendo's Cloud gateway. [Model credentials](/production/model-credentials) covers both.

    A prompt carries your instructions, your theme and knowledge index, the user's messages, and tool schemas. The agent never sees your audit log.
  </Accordion>

  <Accordion title="Where does my data live?" defaultOpen>
    Threads and audit rows live in Vendo Cloud's hosted store. Delete any of it through the erase API, which drops the rows for good.
  </Accordion>

  <Accordion title="What can generated apps reach?" defaultOpen>
    A screen the model writes never runs in your page. Its code runs in a WebAssembly VM that can't touch anything — no DOM, no network, no clock — and your surface renders what comes out. A full generated app runs in a sandbox whose network is an allowlist: it reaches only domains you approved, one approval per domain.

    Their tool calls come back through your server, under the same guard and the same approvals as a call from your own chat.
  </Accordion>
</AccordionGroup>

Every slot also accepts your own adapter, with no key at all. Self-hosting docs are coming.

## The pieces

Five names to know. Each one has its own group in these docs.

<CardGroup cols={3}>
  <Card title="Surface" href="/product/mount-the-surface">
    A sandboxed panel that renders in your brand.

    Mount the surface →
  </Card>

  <Card title="Tools" href="/capabilities/api-tools">
    Your API routes, extracted by `vendo init`.

    API tools →
  </Card>

  <Card title="Guard" href="/generated/in-client-venue">
    Risk grade, approval, audit log on every call.

    Approvals →
  </Card>

  <Card title="Generated UI" href="/generated/apps">
    Real screens built from your own data.

    Generated apps →
  </Card>

  <Card title="Cloud" href="/production/vendo-cloud">
    Runs the store, models, sandbox, and broker.

    Vendo Cloud →
  </Card>
</CardGroup>

## Where things live

init writes the `.vendo` folder. You paste one route.

```text your repo focus={2-4} theme={null}
├─ .vendo/
│  ├─ tools.json     the API calls your agent may make
│  ├─ theme.json     your fonts, colors, radii
│  └─ brief.md       what your product is, in your words
└─ app/api/vendo/[...vendo]/
   └─ route.ts       the one route you pasted
```

Edit these by hand any time. init prints the change instead of overwriting a file you already have.

## Where to go next

Same setup so far. The code differs from here.

<div className="direction-cards">
  <CardGroup cols={3}>
    <Card title="Vendo's Full-Stack Agent" href="/product/quickstart" img="https://mintcdn.com/vendo/VDUQZsZOt7HxLl3m/images/cards/direction-product.svg?fit=max&auto=format&n=VDUQZsZOt7HxLl3m&q=85&s=fc5b65a3f98c1f85abf0968f777ffb25" width="640" height="400" data-path="images/cards/direction-product.svg">
      Vendo runs the loop and renders screens in your brand.

      `<VendoProvider>`

      Quickstart →
    </Card>

    <Card title="In your existing agent" href="/existing-agent/quickstart" img="https://mintcdn.com/vendo/VDUQZsZOt7HxLl3m/images/cards/direction-existing-agent.svg?fit=max&auto=format&n=VDUQZsZOt7HxLl3m&q=85&s=db1266f36ba6990c5fda25ba99941282" width="640" height="400" data-path="images/cards/direction-existing-agent.svg">
      Keep your loop. Vendo adds tools and renders the result.

      `vendoTools(vendo)`

      Quickstart →
    </Card>

    <Card title="From outside agents" href="/outside-agents/quickstart" img="https://mintcdn.com/vendo/VDUQZsZOt7HxLl3m/images/cards/direction-outside-agents.svg?fit=max&auto=format&n=VDUQZsZOt7HxLl3m&q=85&s=e233ceb74355db3f9bab30df9ff968d3" width="640" height="400" data-path="images/cards/direction-outside-agents.svg">
      Your own agent, acting as the signed-in user.

      `createVendo({ mcp: true })`

      Quickstart →
    </Card>
  </CardGroup>
</div>
