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

# Using Harness

The harness path suits cases that need no custom code: the agent's model, tools, knowledge base, memory, and prompt all live in a single `harness.yaml`, which the CLI builds and deploys as a runtime. The whole loop revolves around that one file — initialize, configure, deploy, invoke, then return to configuration to iterate.

> [!NOTE]
>
> Configure credentials first. `harness deploy` is a control-plane operation and requires AK/SK; [SSO login](https://docs.veadk.xyz/productions/agentkit-cli/archives/0.50.5/en/commands/auth.md) currently only covers invoking (`invoke`) a deployed runtime. See the Authentication section of the [Quickstart](https://docs.veadk.xyz/productions/agentkit-cli/archives/0.50.5/en/quickstart.md).

> [!WARNING]
>
> `harness deploy` builds an image and creates or updates a cloud Runtime, which may incur charges. Updating an existing Runtime also changes its production behavior. Confirm the project, region, configuration, and credential references before deployment, and release changes during an appropriate operational window.

**1. Initialize the harness**

Create a harness directory containing `harness.yaml` and `.env.example`.

```bash lines theme={null}
agentkit harness init my-harness
cd my-harness
```

**2. Configure the agent**

Write fields with `harness set`. Only the flags you pass are modified, so you can build up the configuration across several calls.

```bash lines theme={null}
agentkit harness set \
  --name my-harness \
  --model-name doubao-seed-1-6-250615 \
  --system-prompt "You are a concise, helpful agent." \
  --tools web_search
```

> [!TIP]
>
> To configure a component such as a knowledge base or memory, set its `--<component>-type` first, then add the connection parameters; pass an empty string `""` to disable one. Running `agentkit harness set` with no flags lists the current fields. See [Harness](https://docs.veadk.xyz/productions/agentkit-cli/archives/0.50.5/en/commands/harness.md) for the full field list.

**3. Build and deploy**

Build the image in the cloud from `harness.yaml` and create or update the runtime.

```bash lines theme={null}
agentkit harness deploy --project default --region cn-beijing
```

**4. Invoke the runtime**

Call the runtime you just deployed by name; the CLI resolves the endpoint and auth automatically. Invocation is a data-plane operation, so either credential type works: AK/SK, or the STS credentials from an `agentkit login` SSO session.

```bash lines theme={null}
agentkit invoke my-harness -m "Hello, introduce yourself"
```

**5. Iterate**

Change the configuration and redeploy to publish a new version; when the runtime misbehaves, read the instance logs to diagnose it.

```bash lines theme={null}
agentkit harness set --name my-harness --system-prompt "The replacement instruction."
agentkit harness deploy
agentkit runtime logs my-harness --limit 200
```

When you no longer need the runtime, delete it to free resources:

> [!WARNING]
>
> Runtime deletion cannot be undone and stops production calls. Confirm the name, project, and region, and retain required configuration, logs, and business data before proceeding.

```bash lines theme={null}
agentkit runtime delete my-harness -y
```

When you need custom logic, tools, or multi-agent orchestration, use [High-code agents](https://docs.veadk.xyz/productions/agentkit-cli/archives/0.50.5/en/workflows/high-code) instead.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.