create_tap_secret
Create or update a credential secret and inject its fields as environment variables into a tap's Python script at runtime, so taps can authenticate to APIs or databases.
Instructions
Create or update a secret for a tap to use. The secret's fields are injected as environment variables into the tap's Python script at runtime. Use this before create_tap when the tap needs credentials (API key, DB password, etc.). FIRST call list_tap_secrets to check whether a suitable secret already exists — if so, reuse it instead of creating a duplicate. By default, fails if a secret with this name already exists — pass overwrite=true to replace it (ask the user first). Agents can only overwrite secrets that were also created by an agent (tagged _type=tap); secrets owned by a human user must be updated via the UI. If this Datris instance's agent policy requires a person to approve this action, the call does NOT perform it: it returns status pending_approval with an approvalId. Tell the user it is waiting for approval in Datris, then poll get_approval with that id (pause with wait_seconds between polls) — do not re-issue the action.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"name": "<name>",
"fields": "<fields>"
},
"name": "create_tap_secret"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Secret name. Must not use reserved AI-slot names (anthropic, openai, azure, grok, ollama, embedding, ai-primary, codegen). Convention: lowercase, hyphenated, e.g. 'stripe-api-key'. | |
| fields | Yes | Key-value fields. Each key becomes an env var name in the tap script; e.g., {"apiKey": "sk_..."} is read as os.environ['apiKey']. | |
| reason | No | Optional one-line reason for this change, recorded in the platform's audit log and shown to anyone asked to approve it. | |
| overwrite | No | If true, replace an existing secret with the same name. Default false (fails on collision). Only tap-typed secrets can be overwritten by an agent. |