---
title: "Create a secret → tool binding (rehydration policy)"
method: POST
path: "/v1/agents/{agent_id}/tool-bindings"
tags: ["Agents"]
---

# Create a secret → tool binding (rehydration policy)

`POST /v1/agents/{agent_id}/tool-bindings`

## Request

- Base URL: `https://api.1claw.co`
- URL: `https://api.1claw.co/v1/agents/{agent_id}/tool-bindings`
- Auth: HTTP bearer

Authorises the enclave to rehydrate the `⟦sk:…⟧` placeholder for `secret_path`
into `tool_name` at `arg_path` — and only when the call's destination host is one
of `destination_hosts`. Redaction replaces vault secrets in prompts with
deterministic placeholders the model can place but never read; a placeholder is
substituted back only inside an authorised tool-call argument, at the moment the
enclave performs the call (`execution_mode: "tee"`). No binding, wrong argument,
wrong host, bad checksum or an unknown tag is a 403 at execution time. Human users
only; up to 200 per agent.

## Path parameters

- `agent_id` string, uuid, required

## Request body

- CreateToolBindingRequest
  - `secret_path` string, required: Vault path of the secret the placeholder stands for
  - `tool_name` string, required: Tool the binding applies to (`http_request`, `run_sql`, …) or `*`
  - `arg_path` string: JSON pointer into the tool's arguments (`/headers/Authorization`, `/body/*`) or `*` (default)
  - `destination_hosts` string[], required: Hosts the rehydrated call may reach (`api.stripe.com`, `*.googleapis.com`); required

## Response `201`

Created

- SecretToolBinding
  - `id` string, uuid, required
  - `org_id` string, uuid, required
  - `agent_id` string, uuid, required
  - `secret_path` string, required
  - `tool_name` string, required
  - `arg_path` string, required
  - `destination_hosts` string[], required
  - `created_by` string, uuid, nullable
  - `created_at` string, date-time, required

## Other responses

- `400`: Invalid request
- `403`: Insufficient permissions
- `404`: Resource not found
- `409`: A binding for this secret, tool and argument already exists

---

[API](https://skmtc.dev/1claw/apis/1claw-api.md) · [All operations](https://skmtc.dev/1claw/apis/1claw-api/llms.txt) · [OpenAPI document](https://skmtc.dev/1claw/apis/1claw-api/revisions/5fa0918f3b41?raw)
