# Get last agent config

`GET /v1/projects/{project}/last-agent-config`, operation `agents.GetLastAgentConfig`

Gets the config that the caller last created an agent with in the project.

For a person to start the next agent from; it fails with not_found until they've created one, and for service accounts. secretGrants leaves out secrets that were deleted, or that the caller can no longer grant. CreateAgent still takes a config whole, and fills nothing from this.

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `project` | path | Yes | `string` | The project's ID. |

## Responses

### 200

OK

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `config` | `AgentConfig` | Yes | The config as they chose it. An image they left to the default stays empty. |
| `config.environment` | `AgentEnvironmentConfig` | No | The environment the agent runs commands in, with exec, which its first command makes and each starts as it needs to; absent when nothing is set. |
| `config.instructions` | `string` | Yes | Instructions the agent follows, on top of kosem's own. |
| `config.maxModelCalls` | `integer (int32)` | Yes | The most times the agent calls its model after someone last wrote to it, before it pauses as CALL_LIMIT_REACHED until someone writes again. The agents.maxModelCalls policy lowers it where it allows fewer, for running agents too. |
| `config.model` | `string` | Yes | The alias of a model shared with the agent's project, such as claude. |
| `config.reasoningEffort` | `string` | Yes | How much the model reasons before it answers; empty for the model's default. A level the model lacks becomes the nearest it has. Values: "", `NONE`, `MINIMAL`, `LOW`, `MEDIUM`, `HIGH`, `XHIGH`, `MAX`. |
| `config.tools` | `string[]` | Yes | The tools the agent may use, by ID, such as web_search. A tool that the agents.allowedTools policy no longer allows is not offered, with a warning in the transcript. |
| `grants` | `NewAgentGrant[]` | No | Safe carry-over grants from the last agent (read-only access profiles on project-visible agents; all grants on private agents). |
| `secretGrants` | `string[]` | Yes | The secrets they granted it, as projects/{project_id}/secrets/{secret_id}, without those deleted since, or that they can no longer grant. |
| `updateTime` | `string (date-time)` | Yes | When they created that agent. |
| `visibility` | `string` | Yes | Who could see that agent. Values: `PROJECT`, `PRIVATE`. |

### default

Error

Base URL: `https://api.kosem.ai`. See [API conventions](https://docs.kosem.ai/reference/api-conventions.md) for authentication, pagination and errors, and [https://docs.kosem.ai/openapi.yaml](https://docs.kosem.ai/openapi.yaml) for the full OpenAPI document.