# CodePipelineAgent

An AI coding agent in a code pipeline: the engine (coding tool) and model it runs on, its instructions, and the tools it may use.

**Kind:** an object, used in requests and responses. In a request it is called `CodePipelineAgentInput`.

## In a request

| Field | Type | Required | Description |
|---|---|---|---|
| `name` | `string` |  | The agent's name, unique within the pipeline. Steps and agent overrides refer to the agent by it. |
| `defaultEngine` | [`CodeEngineType`](https://docs.maitento.com/reference/types/code-engine-type.md) |  | The engine (coding tool) the agent runs on. A run can switch it with `agentOverrides`. |
| `role` | [`CodePipelineAgentRole`](https://docs.maitento.com/reference/types/code-pipeline-agent-role.md)`\| null` |  | The agent's role. A step can name a role instead of an agent (`targetRole`) and run on any agent with it. Null: the agent can only be chosen by name. |
| `tags` | `string[] \| null` |  | Free-form capability tags. A step can name tags (`targetTags`) and run on any agent carrying at least one of them, ignoring case. |
| `defaultModel` | `string \| null` |  | The model the agent uses, as the engine names it. Null: the engine's default model. A run can switch it with `agentOverrides`. |
| `systemPrompts` | `string[] \| null` |  | The agent's own system prompts, combined with the pipeline's as `systemPromptMode` says. |
| `enginePrompts` | [`CodePipelineAgentEnginePromptInput`](https://docs.maitento.com/reference/types/code-pipeline-agent-engine-prompt.md#in-a-request)`[] \| null` |  | Extra prompts used only when the agent runs on a particular engine, added after its `systemPrompts`. |
| `systemPromptMode` | [`CodePipelineSystemPromptMode`](https://docs.maitento.com/reference/types/code-pipeline-system-prompt-mode.md)`\| null` |  | How the agent's `systemPrompts` combine with the pipeline's: `Additional` (the default) adds them after the pipeline's, `Override` uses only the agent's. |
| `externalOperationsMcp` | [`McpExternalOperationBindingInput`](https://docs.maitento.com/reference/types/mcp-external-operation-binding.md#in-a-request)`[] \| null` |  | MCP tools this agent may use, in addition to the pipeline's own. |
| `externalOperationsOpenApi` | [`OpenApiExternalOperationBindingInput`](https://docs.maitento.com/reference/types/open-api-external-operation-binding.md#in-a-request)`[] \| null` |  | OpenAPI tools this agent may use, in addition to the pipeline's own. |
| `allowWebTools` | `boolean \| null` |  | Whether this agent gets Maitento's web tools, overriding the pipeline's `allowWebTools`. Null: as the pipeline says. |

```json
{
  "name": "...",
  "defaultEngine": "Claude",
  "role": "Architect",
  "tags": [
    "..."
  ],
  "defaultModel": "...",
  "systemPrompts": [
    "..."
  ],
  "enginePrompts": [
    {
      "engine": "Claude",
      "prompts": []
    }
  ],
  "systemPromptMode": "Additional",
  "externalOperationsMcp": [
    {
      "name": "...",
      "externalOperationId": "3f2b8c1e-5d4a-4e6b-9c7d-2a1b0c9d8e7f",
      "externalOperationVersion": 0,
      "requestBindings": [],
      "authenticationHeader": {},
      "promptGuidance": "...",
      "isTerminal": false
    }
  ],
  "externalOperationsOpenApi": [
    {
      "pathBindings": [],
      "queryBindings": [],
      "name": "...",
      "externalOperationId": "3f2b8c1e-5d4a-4e6b-9c7d-2a1b0c9d8e7f",
      "externalOperationVersion": 0,
      "requestBindings": [],
      "authenticationHeader": {},
      "promptGuidance": "...",
      "isTerminal": false
    }
  ],
  "allowWebTools": false
}
```

## In a response

Every field is present in a response; empty ones are `null`.

| Field | Type | Description |
|---|---|---|
| `name` | `string` | The agent's name, unique within the pipeline. Steps and agent overrides refer to the agent by it. |
| `defaultEngine` | [`CodeEngineType`](https://docs.maitento.com/reference/types/code-engine-type.md) | The engine (coding tool) the agent runs on. A run can switch it with `agentOverrides`. |
| `role` | [`CodePipelineAgentRole`](https://docs.maitento.com/reference/types/code-pipeline-agent-role.md)`\| null` | The agent's role. A step can name a role instead of an agent (`targetRole`) and run on any agent with it. Null: the agent can only be chosen by name. |
| `tags` | `string[] \| null` | Free-form capability tags. A step can name tags (`targetTags`) and run on any agent carrying at least one of them, ignoring case. |
| `defaultModel` | `string \| null` | The model the agent uses, as the engine names it. Null: the engine's default model. A run can switch it with `agentOverrides`. |
| `systemPrompts` | `string[] \| null` | The agent's own system prompts, combined with the pipeline's as `systemPromptMode` says. |
| `enginePrompts` | [`CodePipelineAgentEnginePrompt`](https://docs.maitento.com/reference/types/code-pipeline-agent-engine-prompt.md)`[] \| null` | Extra prompts used only when the agent runs on a particular engine, added after its `systemPrompts`. |
| `systemPromptMode` | [`CodePipelineSystemPromptMode`](https://docs.maitento.com/reference/types/code-pipeline-system-prompt-mode.md)`\| null` | How the agent's `systemPrompts` combine with the pipeline's: `Additional` (the default) adds them after the pipeline's, `Override` uses only the agent's. |
| `externalOperationsMcp` | [`McpExternalOperationBinding`](https://docs.maitento.com/reference/types/mcp-external-operation-binding.md)`[] \| null` | MCP tools this agent may use, in addition to the pipeline's own. |
| `externalOperationsOpenApi` | [`OpenApiExternalOperationBinding`](https://docs.maitento.com/reference/types/open-api-external-operation-binding.md)`[] \| null` | OpenAPI tools this agent may use, in addition to the pipeline's own. |
| `allowWebTools` | `boolean \| null` | Whether this agent gets Maitento's web tools, overriding the pipeline's `allowWebTools`. Null: as the pipeline says. |

```json
{
  "name": "...",
  "defaultEngine": "Claude",
  "role": "Architect",
  "tags": [
    "..."
  ],
  "defaultModel": "...",
  "systemPrompts": [
    "..."
  ],
  "enginePrompts": [
    {
      "engine": "Claude",
      "prompts": []
    }
  ],
  "systemPromptMode": "Additional",
  "externalOperationsMcp": [
    {
      "name": "...",
      "externalOperationId": "3f2b8c1e-5d4a-4e6b-9c7d-2a1b0c9d8e7f",
      "externalOperationVersion": 0,
      "requestBindings": [],
      "authenticationHeader": {},
      "promptGuidance": "...",
      "isTerminal": false
    }
  ],
  "externalOperationsOpenApi": [
    {
      "pathBindings": [],
      "queryBindings": [],
      "name": "...",
      "externalOperationId": "3f2b8c1e-5d4a-4e6b-9c7d-2a1b0c9d8e7f",
      "externalOperationVersion": 0,
      "requestBindings": [],
      "authenticationHeader": {},
      "promptGuidance": "...",
      "isTerminal": false
    }
  ],
  "allowWebTools": false
}
```

## Where it's used

- Inside [`CodePipelineCreateRequest`](https://docs.maitento.com/reference/types/code-pipeline-create-request.md)
- Inside [`CodePipelineProcess`](https://docs.maitento.com/reference/types/code-pipeline-process.md)
- Inside [`CodePipelineProcessStartRequest`](https://docs.maitento.com/reference/types/code-pipeline-process-start-request.md)
- Inside [`CodePipelineUpdateRequest`](https://docs.maitento.com/reference/types/code-pipeline-update-request.md)
- Inside [`CodePipelineVersion`](https://docs.maitento.com/reference/types/code-pipeline-version.md)
