Connecting Managed Tools to an Agent Runtime: A Deployment and Approval Guide
This guide explains how to divide responsibilities between a lightweight agent runtime (Harness) and external components. It compares self-built and managed components, outlines how to evaluate a managed agent service and set its budget, and walks through connecting an OpenAI-compatible model and memory components. It also covers the approval, timeout, and audit settings you need to configure yourself.
1. Defining the Runtime’s Responsibilities
A lightweight agent runtime (Harness) typically handles three tasks: dispatching model calls and tool calls, requesting human approval before high-risk operations, and maintaining the task plan. Models, tools, memory, and sandboxes are provided by external components and connect through a unified interface.
This split keeps the core logic stable. When you swap a model or add a tool, you usually only need to change configuration and components, not the scheduling code. However, the boundary also means you must explicitly configure approvals, timeouts, and auditing. The runtime does not decide on its own which operations are dangerous. Before integration, list your operations and assign a risk level to each category: reads, writes, deletions, permission changes, financial operations, and external requests.
2. Slot Interfaces and Component Selection
Each slot depends on an interface contract. Before integrating, confirm four things: the input and output formats, the timeout values, the meaning of each error code, and whether retries are supported.
- Model slot: Used for text inference. It may also include image understanding, speech transcription, and other capabilities. When selecting a model, consider context length, tool-calling stability, and unit price.
- Tool slot: Each tool should have a clearly defined parameter schema and return structured results. When a tool fails, it should return a recognizable error type rather than a natural-language description.
- Memory slot: Distinguish between the short-term session window and long-term vector memory. They have different write latency and consistency requirements, so design them separately.
- Sandbox slot: Used to execute model-generated code. The sandbox should restrict network access, filesystem scope, and runtime duration.
When choosing components, you can compare self-built and managed options. The table below summarizes the main differences.
| Dimension | Self-built component | Managed preconfigured component |
|---|---|---|
| Integration speed | Depends on how familiar the team is with the interfaces; usually slower | Usually comes with ready-made configuration; faster |
| Permission control | Fully defined by you | Constrained by the vendor’s permission model; each item must be checked |
| Cost visibility | Can be metered per component | May be billed together; confirm the billing granularity |
| Observability | Depends on your own logging system | Depends on the tracing features the platform provides |
| Migration cost | Lower | Higher if you depend on proprietary interfaces |
3. Choosing a Managed Agent Service and Calculating the Budget
A managed agent service bundles components such as search, content extraction, and long-term memory, and offers a unified quota. These services suit teams that want to reduce integration work. Before choosing one, confirm the following:
- Whether the unified quota covers model calls, tool calls, and knowledge base retrieval. When the quota runs out, does the service stop calls or switch to pay-as-you-go billing?
- Whether billing can be split by application, environment, or team, so cost anomalies are easier to trace.
- Whether the components follow the OpenAI-compatible interface. The degree of compatibility determines whether you can switch providers without changing business code.
- Whether the data storage region and retention period meet your compliance requirements.
For budgeting, set a quota cap for each environment and send an alert when usage reaches 80%. Do not rely only on the platform’s default quotas.
4. End-to-End Integration Steps
4.1 Installation and Pre-Launch Checks
Use the official documentation for your Harness version to find the correct installation commands. Before starting, confirm three things: your Node.js version meets the documented requirement, the local port is not already in use, and the configuration file contains no plaintext secrets.
After launch, the console listens on the local loopback address by default. For remote access, place it behind a reverse proxy and enable authentication. Do not expose the console directly to the public internet.
4.2 Connecting an OpenAI-Compatible Model
In the model settings, choose a custom provider and fill in the following fields:
- base_url: The API root address provided by your managed platform, usually ending in
/v1. - api_key: Read from an environment variable, for example
CLOUD_API_KEY. Do not write it into the configuration file or commit it to a code repository. - model: The chat model name.
- embedding_model: The embedding model name used by long-term memory.
You can test connectivity with curl and confirm that the chat endpoint returns a response. Before running the command, set three environment variables: BASE_URL, CLOUD_API_KEY, and CHAT_MODEL.
curl "$BASE_URL/chat/completions" \-H "Authorization: Bearer $CLOUD_API_KEY" \-H "Content-Type: application/json" \-d "{\"model\":\"$CHAT_MODEL\",\"messages\":[{\"role\":\"user\",\"content\":\"ping\"}],\"max_tokens\":8}"
If the request fails, use these checks. A 401 response means the key may have expired, or its permission scope may not include this model. A 404 response means base_url may have an extra or missing path prefix. An empty tool-call field means the model or gateway does not fully support function calling. In that case, replace the model or disable the related features before going live. Test the vector endpoint separately, and confirm that the returned vector dimension matches the memory index dimension. If they differ, writes will fail or retrieval results will be wrong.
Keep keys separate for each environment and rotate them regularly. Never log a full key. Keep only the last few characters so you can identify it.
4.3 Enabling Memory and Tool Components
In the plugin marketplace, choose the long-term memory component and the retrieval component. Before choosing, record each component’s dependencies, such as the vector database type and the embedding model dimension.
