> ## 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 AK/SK credentials first, or obtain short-lived STS credentials through [SSO login](/productions/agentkit-cli/preview/en/commands/auth). `harness deploy` requires control-plane credentials; `harness invoke` uses control-plane credentials to resolve the Runtime and can pass an additional user token for `custom_jwt` Runtimes. See the Authentication section of the [Quickstart](/productions/agentkit-cli/preview/en/quickstart).
</Note>

<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.
</Warning>

<Steps>
  <Step title="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
    ```
  </Step>

  <Step title="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 "your-model-name" \
      --system-prompt "You are a concise, helpful agent."
    ```

    <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](/productions/agentkit-cli/preview/en/commands/harness) for the full field list.
    </Tip>
  </Step>

  <Step title="Check cloud settings and component access">
    Replace `your-model-name` with a model or endpoint ID available to your account. Default direct model calls require suitable model access on the Runtime role; a successful deployment does not grant model access. Verify a minimal reply without external tools before adding knowledge bases, MCP services, or memory

    This example uses Volcengine Beijing. For BytePlus, initialize with `agentkit --provider byteplus harness init my-harness --region ap-southeast-1` and keep deployment and query regions consistent. Reference database passwords and MCP credentials as `${VAR}` in `harness.yaml`, with actual values in an uncommitted `.env`
  </Step>

  <Step title="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
    ```
  </Step>

  <Step title="Invoke the runtime">
    Call the runtime you just deployed by name. The CLI resolves the endpoint and authentication automatically, using configured AK/SK credentials or valid STS credentials from the active SSO login profile.

    ```bash lines theme={null}
    agentkit runtime show my-harness
    agentkit harness invoke my-harness "Hello, introduce yourself"
    ```
  </Step>

  <Step title="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
    ```
  </Step>
</Steps>

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.
</Warning>

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

When you need custom logic, tools, or multi-agent orchestration, use [High-code agents](/productions/agentkit-cli/preview/en/workflows/high-code) instead.
