| 1 | --- |
| 2 | title: g1t agents |
| 3 | description: Have g1t's own agents work on an intent. |
| 4 | --- |
| 5 | |
| 6 | g1t can do the work itself. On an open intent, **Run g1t agents** starts up |
| 7 | to five agents at once. Each gets its own sandbox and its own fork, works |
| 8 | independently, and reports back as it goes. |
| 9 | |
| 10 | This is in preview and limited to selected accounts. Everyone can |
| 11 | [bring their own agent](/guides/bring-your-own-agent/) today. |
| 12 | |
| 13 | ## Starting a run |
| 14 | |
| 15 | 1. Open an intent on a repository. |
| 16 | 2. In **Run g1t agents**, choose how many agents to race and which model |
| 17 | they use. |
| 18 | 3. Optionally add guidance for this run, on top of the intent's brief. |
| 19 | 4. Choose **Run**. |
| 20 | |
| 21 | Each agent appears as an attempt on the intent within a few seconds. The |
| 22 | page updates on its own while they work. |
| 23 | |
| 24 | ## What an agent does |
| 25 | |
| 26 | 1. Clones its attempt's fork. |
| 27 | 2. Reads the code and makes the change the intent asks for. |
| 28 | 3. Commits its work. |
| 29 | 4. Pushes to the fork and submits the attempt with a summary. |
| 30 | |
| 31 | Everything it reads, runs and decides is recorded in the attempt's |
| 32 | **Session** as it happens. The **Changes** tab shows the resulting diff. |
| 33 | |
| 34 | ## Choosing between attempts |
| 35 | |
| 36 | Open each attempt, read its summary and its changes, and ship the one you |
| 37 | want. Shipping lands it on `main` and closes the intent. See |
| 38 | [shipping](/concepts/overview/#shipping) for what happens when `main` has moved. |
| 39 | |
| 40 | ## Choosing a model |
| 41 | |
| 42 | When you start a run you pick how much model to spend on it: |
| 43 | |
| 44 | | Choice | Use it for | |
| 45 | | --- | --- | |
| 46 | | **Balanced** | Most tasks. The default. | |
| 47 | | **Deep** | Hard problems that need the strongest reasoning. Slower and costlier. | |
| 48 | | **Fast** | Small, well-defined changes. | |
| 49 | |
| 50 | These are g1t's names, not a vendor's. Which model stands behind each one is |
| 51 | g1t's choice and can change without your intents or automations changing. |
| 52 | An agent's attempt carries the label `g1t-agent`. |
| 53 | |
| 54 | ## How model traffic is routed |
| 55 | |
| 56 | g1t agents can send every model request through |
| 57 | [Cloudflare AI Gateway](https://developers.cloudflare.com/ai-gateway/). The |
| 58 | gateway is where an operator sees each request, caps spend, caches, and |
| 59 | sets a fallback to another provider if one is down, without changing |
| 60 | anything in g1t. |
| 61 | |
| 62 | If you run your own copy of g1t, two settings on the runner control this: |
| 63 | |
| 64 | | Setting | What it does | |
| 65 | | --- | --- | |
| 66 | | `AGENT_MODELS` | The choices offered, in order, each mapped to a provider's model. | |
| 67 | | `AI_GATEWAY_ID` | The gateway to route through. Empty sends requests to the provider directly. | |
| 68 | |
| 69 | ## Limits in the preview |
| 70 | |
| 71 | - Sandboxes have git and common shell tools, but not every language's |
| 72 | toolchain. An agent may not be able to build or test your project, and |
| 73 | will say so in its summary. |
| 74 | - An agent is given one fork and the intent. Its credential, though, is |
| 75 | your account's for the length of the run; credentials limited to the |
| 76 | attempt are planned. |
| 77 | - A run has two hours. After that its credential expires and it can no |
| 78 | longer push or report. |
| 79 | |
| 80 | ## What a sandbox can reach |
| 81 | |
| 82 | A sandbox holds one fork and a credential that expires two hours after the |
| 83 | run starts. |
| 84 | That credential, and the model key the agent runs on, are removed from |
| 85 | anything recorded in the session. |