Set Secret Field from Local Value
set_secret_field_environment_variableStores a value from your machine into a Delinea secret field without exposing it to the model, for external credentials such as AWS API keys or tokens.
Instructions
Store a value from the user's machine in a secret field, unseen by the model.
Use this for values that cannot be generated by Delinea (e.g. AWS API
keys, external tokens). The value is written with
PUT /v1/secrets/{id}/fields/{slug} and never enters the conversation.
When the server runs locally (stdio):
file:sources are read and uploaded by the server directly; the file's contents are stored as-is (a trailing newline is dropped).env:andstdinsources return a one-linecommandthat runs this package's own Python to read the value (hidden prompt forstdin) and upload it. Nothing else needs to be installed. The command's job file holds a short-lived access token, is private, and deletes itself when used or after 15 minutes. Withstdinthe user must run the command in their own terminal.
Over HTTP transports a script is returned instead (bash needs curl and jq, cmd needs curl).
For new secrets, first create the secret (with a placeholder or via
create_secret_with_generated_password), then use this tool to populate
external fields.
Before modifying a secret, check whether it requires approval:
Call
get_secret(id, summary=True)and inspectrequiresApprovalandrequiresComment.If approval is required, call
get_pending_access_requests()to check for an existing grant, or request access and wait for approval viahandle_access_request().Always provide the comment parameter explaining why this secret is being modified. If the action is tied to a ticket, incident, or change request, that reference must be named in the comment.
Parameters
secret_id:
ID of the existing secret to update.
field_slug:
Field slug name (e.g. "password", "username", "api-key").
Use check_secret_template to discover slugs.
environment:
Target shell — "bash", "powershell" or "cmd".
source:
Where to read the value. Options:
* ``"env:VAR_NAME"`` — read from environment variable *VAR_NAME*
* ``"file:/path/to/file"`` — read from a file
* ``"stdin"`` — prompt the user to type/paste (default)
comment:
Required when the secret has requiresComment or
requiresApproval set. Must explain why this secret is
being modified and, if the action is tied to a formal request
(e.g. a Jira ticket, incident, or change request), that
reference must be included.
Returns
dict
result (file: source) or command (env:/stdin) in
local mode.
str
The script text (HTTP transports).
dict
Error information if the secret requires approval or a comment
that was not provided.
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": {
"secret_id": "<secret_id>",
"field_slug": "<field_slug>",
"environment": "<environment>"
},
"name": "set_secret_field_environment_variable"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | No | stdin | |
| comment | No | ||
| secret_id | Yes | ||
| field_slug | Yes | ||
| environment | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |