Add or replace a release policy
set_policyAdd a release policy to an organization, or replace the one with the same name. A policy runs its checker on every publish. It monitors by default: it records findings and never refuses a release. A blocking policy refuses a release that has a finding at or above that severity, or that the checker could not evaluate; block needs block_at, and block_at alone means block. list_policies shows the checkers and their settings.
Replacing a policy replaces its settings: pass every non-secret setting again. A change to a policy applies to releases not yet decided. Changing a policy's enforcement or settings never changes a decided evaluation, and a running policy evaluation keeps the checker and enforcement it started with. A running policy evaluation whose checker hasn't started yet uses the current settings. Removing a policy, or changing its checker, cancels its running policy evaluations, so releases that waited only on it go ahead.
A checker with secret fields, such as an API token, does not take them here. The answer carries a request whose url an Admin opens, signed in to Valet, to enter them; the policy is saved when they do, and a field left blank keeps its stored value. A request is made only when a required secret is not stored yet, or replace_secrets is true to enter them again. Say in reason why the checker needs them. Give the person the url, then follow the request with get_request. Never ask for a secret in this conversation. Otherwise the policy saves at once. Returns the saved policy's checker, enforcement, and block_at, which settings were set and which secrets were kept, and the request when a person enters secrets first. Requires connecting a Valet account. Requires the Admin 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": {
"policy": "<policy>",
"checker": "<checker>"
},
"name": "set_policy"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| policy | Yes | What to call the policy, such as dependencies, so list_policies and destroy_policy can name it. Saving under a name already in use replaces that policy. | |
| reason | No | Shown to the person on the request page to explain why the values are needed, so they can decide whether to enter them, such as: The checker calls your scanner and needs its API token. | |
| checker | Yes | The checker to run, spelled as list_policies reports it, such as catalog:secrets. | |
| block_at | No | The least serious finding that stops a release; findings below it are only recorded. Omit it for a policy that only records findings, unless enforcement is block, which needs it. | |
| org_name | No | The Valet organization that owns the policy. Omit to use the organization the account joined first. | |
| settings | No | The checker's non-secret settings, as field name to value. Secret fields are entered by a person on the request page, never here. | |
| enforcement | No | What a finding does: monitor records it for the team to read, and block also stops the release. Start with monitor to see what a checker finds before it can hold up publishing. | |
| replace_secrets | No | Ask the person to enter the checker's secrets again, replacing the stored ones. The request lists every secret field, required or not. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| org | Yes | Name of the Valet organization the call acted in. | |
| policy | Yes | The policy's name. | |
| checker | Yes | The checker the policy runs. | |
| request | No | The request a person completes in the dashboard to enter a value that must not pass through this conversation. Absent when nothing needs a person. | |
| block_at | No | The lowest severity that blocks. Absent when no severity was set. | |
| enforcement | Yes | monitor or block. While request is set the policy is not saved yet, and this is what it is saved as when the person completes the request. | |
| secrets_kept | No | Names of the secret settings that kept their stored values. Absent when none did, or when a request is pending. | |
| settings_set | No | Names of the non-secret settings the call gave. Absent when it gave none. |