Set secret
set_secretDeprecated, removed in 2.0: use manage_secrets with action set. Create a secret or replace its value in one environment. The previous value stays in the version history (secret_history lists it, restore_secret_version brings it back). Pass expectedVersion, from list_secrets, to write only if nobody changed the key since you read it. For many keys use import_env; to copy keys between environments without seeing the values use copy_environment. Protected and sealed keys are refused. The value is never echoed back. Audited. Requires secrets:write and the editor role.
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": {
"project": "<project>",
"environment": "<environment>",
"key": "<key>",
"value": "<value>"
},
"name": "set_secret"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | Secret key, e.g. DATABASE_URL | |
| kind | No | secret (masked, the default for a new key) or plain (shown unmasked in the UI and in list_secrets, for non-sensitive settings). Omit it to keep the current kind | |
| note | No | Short note shown next to the key, up to 500 characters. Omit it to keep the current note | |
| value | Yes | The value to store, up to 64 KB, encrypted at rest | |
| project | Yes | Project slug or id | |
| environment | Yes | Environment slug or id, e.g. development, preview or production | |
| expectedVersion | No | Update only if the key is still at this version (the version list_secrets showed); a changed, renamed or deleted key fails instead of being written over or created |