Update an existing prompt and create a new archived version. Only provided fields change, and publish_prompt is what makes the new version active. For multi-message chat prompts pass messages (preferred) or a JSON-encoded array as string.
AI agents use update_prompt to create or update resources in Portkey Admin — usually the action step of a workflow, after the agent has gathered context. Every call changes real data in your Portkey Admin environment.
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | — | New display name for the prompt |
model | string | — | New model identifier |
tools | array | — | New tool definitions |
string | string | — | Legacy prompt template string. Use plain text for single-message prompts, or a JSON-encoded messages array string for multi-message chat prompts. |
dry_run | boolean | — | When true, validate without updating |
messages | array | — | Structured chat template alias for updates. Serialized to the legacy string format before the prompt is updated. |
functions | array | — | New function definitions |
prompt_id | string | Yes | Prompt ID or slug to update |
parameters | object | — | New default values for template variables |
tool_choice | object | — | New tool choice strategy |
virtual_key | string | — | New virtual key slug |
collection_id | string | — | Move to a different collection |
Parameters from the server's own tool schema.
An AI agent can call update_prompt faster than any human can review — one bad instruction and it creates or modifies resources in Portkey Admin by the hundred, each call as confident as the last.
Risk signalsAccepts raw HTML/template content (messages[].content) · High parameter count (28 properties)
Attacks that exploit this kind of access
Update an existing prompt and create a new archived version. Only provided fields change, and publish_prompt is what makes the new version active. For multi-message chat prompts pass messages (preferred) or a JSON-encoded array as string. It is categorised as a Write tool in the Portkey Admin MCP Server, which means it can create or modify data. Consider rate limits to prevent runaway writes.
update_prompt accepts 12 parameters: name, model, tools, string, dry_run, messages, functions, prompt_id, parameters, tool_choice, virtual_key, collection_id. Required: prompt_id. The full parameter table on this page comes from the server's own tool schema.
Register the Portkey Admin MCP server in PolicyLayer and add a rule for update_prompt: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Portkey Admin. Nothing to install.
update_prompt is a Write tool with medium risk. Write tools should be rate-limited to prevent accidental bulk modifications.
Yes. Add a rate_limit block to the update_prompt rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for update_prompt. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
update_prompt is provided by the Portkey Admin MCP server (CodesWhat/portkey-admin-mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.