> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.islo.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.islo.dev/_mcp/server.

# Update Agent

PATCH https://api.islo.dev/factories/{factory}/agents/{name}
Content-Type: application/json

Reference: https://docs.islo.dev/api-reference/agents/update-factory-agent

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `factory` (string, required)
- `name` (string, required)

### Body (application/json)

This endpoint expects an agents_update_factory_agent_Request.

- `agents_update_factory_agent_Request`
  - `type`: `decision` (DecisionAgentUpdate)
    - `machine` (string, required) — Name of an existing Machine in this Factory
    - `questions` (map from string to FactoriesFactoryAgentsNamePatchRequestBodyContentApplicationJsonSchemaDiscriminatorMappingDecisionQuestions, required)
    - `color` (string, optional, nullable)
    - `description` (string, optional, nullable)
    - `icon` (string, optional, nullable)
    - `input_kind` (enum, optional, default: text)
      - Allowed values: `text`, `image`
    - `model` (string, optional, nullable) — Enabled model supporting typesafe_system_one. Discover choices with GET /inference/models and check client_apis.
  - `type`: `prompt` (PromptAgentUpdate)
    - `harness` (enum, required)
      - Allowed values: `codex`, `cursor`, `claude`, `opencode`
    - `machine` (string, required) — Name of an existing Machine in this Factory
    - `model` (string, required)
    - `prompt` (string, required)
    - `color` (string, optional, nullable)
    - `description` (string, optional, nullable)
    - `effort` (enum, optional, nullable)
      - Allowed values: `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max`
    - `icon` (string, optional, nullable)
    - `mcp` (list of AgentMcp, optional)
    - `model_provider` (enum, optional, nullable)
      - Allowed values: `islo`, `islo_inference`
    - `skills` (list of string, optional)
  - `type`: `script` (ScriptAgentUpdate)
    - `commands` (list of string, required)
    - `machine` (string, required) — Name of an existing Machine in this Factory
    - `color` (string, optional, nullable)
    - `description` (string, optional, nullable)
    - `icon` (string, optional, nullable)

## Response

### 200

Successful Response

- `agents_update_factory_agent_Response_200`
  - `type`: `decision` (DecisionAgentResponse)
    - `color` (string, required)
    - `description` (string, required, nullable)
    - `icon` (string, required)
    - `id` (string, required)
    - `machine` (string, required)
    - `model` (string, required)
    - `name` (string, required)
    - `questions` (map from string to FactoriesFactoryAgentsNamePatchResponsesContentApplicationJsonSchemaDiscriminatorMappingDecisionQuestions, required)
    - `input_kind` (enum, optional, default: text)
      - Allowed values: `text`, `image`
  - `type`: `prompt` (PromptAgentResponse)
    - `color` (string, required)
    - `description` (string, required, nullable)
    - `harness` (string, required)
    - `icon` (string, required)
    - `id` (string, required)
    - `machine` (string, required)
    - `model` (string, required)
    - `name` (string, required)
    - `prompt` (string, required)
    - `effort` (string, optional, nullable)
    - `mcp` (list of AgentMcp, optional)
    - `model_provider` (enum, optional, nullable)
      - Allowed values: `islo`, `islo_inference`
    - `skills` (list of string, optional)
  - `type`: `script` (ScriptAgentResponse)
    - `color` (string, required)
    - `commands` (list of string, required)
    - `description` (string, required, nullable)
    - `icon` (string, required)
    - `id` (string, required)
    - `machine` (string, required)
    - `name` (string, required)

## Errors

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### FactoriesFactoryAgentsNamePatchRequestBodyContentApplicationJsonSchemaDiscriminatorMappingDecisionQuestions

- `type`: `choice` (DecisionChoiceQuestion)
  - `criteria` (map from string to string, required)
  - `instructions` (string, required)
- `type`: `noul` (DecisionNoulQuestion)
  - `instructions` (string, required)
- `type`: `score` (DecisionScoreQuestion)
  - `criteria` (list of string, required)
  - `instructions` (string, required)

### AgentMcp

- `key` (string, required)
- `url` (string, required)

### FactoriesFactoryAgentsNamePatchResponsesContentApplicationJsonSchemaDiscriminatorMappingDecisionQuestions

- `type`: `choice` (DecisionChoiceQuestion)
  - `criteria` (map from string to string, required)
  - `instructions` (string, required)
- `type`: `noul` (DecisionNoulQuestion)
  - `instructions` (string, required)
- `type`: `score` (DecisionScoreQuestion)
  - `criteria` (list of string, required)
  - `instructions` (string, required)

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)
- `ctx` (ValidationErrorCtx, optional)
- `input` (any, optional)

### ValidationErrorLocItems

- string
- integer

### ValidationErrorCtx

## Examples

**Request**

```json
{
  "harness": "codex",
  "machine": "string",
  "model": "string",
  "prompt": "string",
  "type": "string"
}
```

**Response**

```json
{
  "color": "string",
  "description": "string",
  "effort": "string",
  "harness": "string",
  "icon": "string",
  "id": "string",
  "machine": "string",
  "mcp": [
    {
      "key": "string",
      "url": "string"
    }
  ],
  "model": "string",
  "model_provider": "islo",
  "name": "string",
  "prompt": "string",
  "skills": [
    "string"
  ],
  "type": "string"
}
```

**SDK Code**

```python
import requests

url = "https://api.islo.dev/factories/factory/agents/name"

payload = {
    "harness": "codex",
    "machine": "string",
    "model": "string",
    "prompt": "string",
    "type": "string"
}
headers = {
    "X-Islo-Api-Version": "X-Islo-Api-Version",
    "Authorization": "Bearer <api_key>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.islo.dev/factories/factory/agents/name';
const options = {
  method: 'PATCH',
  headers: {
    'X-Islo-Api-Version': 'X-Islo-Api-Version',
    Authorization: 'Bearer <api_key>',
    'Content-Type': 'application/json'
  },
  body: '{"harness":"codex","machine":"string","model":"string","prompt":"string","type":"string"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.islo.dev/factories/factory/agents/name"

	payload := strings.NewReader("{\n  \"harness\": \"codex\",\n  \"machine\": \"string\",\n  \"model\": \"string\",\n  \"prompt\": \"string\",\n  \"type\": \"string\"\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("X-Islo-Api-Version", "X-Islo-Api-Version")
	req.Header.Add("Authorization", "Bearer <api_key>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.islo.dev/factories/factory/agents/name")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["X-Islo-Api-Version"] = 'X-Islo-Api-Version'
request["Authorization"] = 'Bearer <api_key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"harness\": \"codex\",\n  \"machine\": \"string\",\n  \"model\": \"string\",\n  \"prompt\": \"string\",\n  \"type\": \"string\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.islo.dev/factories/factory/agents/name")
  .header("X-Islo-Api-Version", "X-Islo-Api-Version")
  .header("Authorization", "Bearer <api_key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"harness\": \"codex\",\n  \"machine\": \"string\",\n  \"model\": \"string\",\n  \"prompt\": \"string\",\n  \"type\": \"string\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.islo.dev/factories/factory/agents/name', [
  'body' => '{
  "harness": "codex",
  "machine": "string",
  "model": "string",
  "prompt": "string",
  "type": "string"
}',
  'headers' => [
    'Authorization' => 'Bearer <api_key>',
    'Content-Type' => 'application/json',
    'X-Islo-Api-Version' => 'X-Islo-Api-Version',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.islo.dev/factories/factory/agents/name");
var request = new RestRequest(Method.PATCH);
request.AddHeader("X-Islo-Api-Version", "X-Islo-Api-Version");
request.AddHeader("Authorization", "Bearer <api_key>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"harness\": \"codex\",\n  \"machine\": \"string\",\n  \"model\": \"string\",\n  \"prompt\": \"string\",\n  \"type\": \"string\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-Islo-Api-Version": "X-Islo-Api-Version",
  "Authorization": "Bearer <api_key>",
  "Content-Type": "application/json"
]
let parameters = [
  "harness": "codex",
  "machine": "string",
  "model": "string",
  "prompt": "string",
  "type": "string"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.islo.dev/factories/factory/agents/name")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```