AI

AgentOps: validate MCP elicitation before collecting production data

A production runbook for qualifying an MCP input request, separating form and URL flows, bounding collected data, and validating acceptance, refusal or rollback.

25 Oct 2026 aiagentopsmcpelicitationtoolssecurityprivacyapprovalsevaluationguardrailsobservabilityautomationrunbookrollbackproduction

An operations agent calls an MCP tool to prepare a maintenance task. Mid-call, the server asks the user to confirm the environment, select a maintenance window and provide a change ID. The client displays a credible form, so the operator completes it to unblock the runbook.

That request is not just another agent message. MCP elicitation is initiated by the server during a call: the client gathers a structured response and sends it back to the server. This creates another trust boundary. An overbroad schema can collect unnecessary data; an unqualified URL can divert the user; an Accept button can be mistaken for approval of the final action.

The running case is a maintenance.prepare tool that needs a change reference and a time window, but must receive no secret and must not authorize a restart. The goal is to qualify the contract, client rendering and workflow resumption before enabling the capability in production.

Contain the capability before inspecting the form

Return write tools to mandatory approval and disable elicitation on the production client if it appeared without a planned change. Preserve the user request, tool call, raw elicitation/create request, result and the action proposed afterward.

Do not replay the request with real values. Use a test client and a non-writing identity so the first trace remains intact and apparently harmless input cannot continue the operation.

yaml 01-elicitation-incident.yml
incident: INC-AI-825
agent_release: ops-agent-2026.10.25-1
server: operations-mcp
tool: maintenance.prepare
server_version: 4.8.0
elicitation:
mode: form
message_digest: <sha256>
schema_digest: <sha256>
fields:
  - change_id
  - maintenance_window
result_action: accept
proposed_next_step: maintenance.restart
containment:
elicitation_enabled: false
write_tools: approval_always
test_identity: mcp-elicitation-canary
evidence:
trace_id: <trace-id>
client_version: <version>

A successful initial call does not prove that collection is safe. Follow the entire chain: requesting server, rendering client, responding user, server interpretation and any tool invoked next.

Separate form input, URL flows and approval

MCP lets a client advertise the elicitation modes it can handle. form mode collects structured values inside the client interface. url mode opens an out-of-band flow for sensitive interactions that should not pass through the agent context.

Neither mechanism replaces tool approval:

  1. elicitation gathers information or an intermediate decision;
  2. approval authorizes one specific tool call with visible arguments;
  3. target-system authorization finally decides whether the identity may perform it.

Accepting a form must never become implicit permission to restart, delete or modify a resource. The runtime must retain a distinct approval step for the sensitive action.

text 02-trust-boundaries.txt
FORM ELICITATION
Suitable: change ID, environment enum, maintenance window
Forbidden by policy: password, API key, access token, payment data

URL ELICITATION
Suitable: OAuth or another sensitive out-of-band interaction
Required controls: trusted origin, visible destination, request binding, expiry

TOOL APPROVAL
Suitable: authorize one named action with exact arguments
Must remain separate from form acceptance and URL completion

If the client did not declare the required mode, the server must fail cleanly. Falling back to asking for the same sensitive value in chat or a free-text field is a security failure, not acceptable degradation.

Review the request as a data contract

Inspect the request received by the client, not only the rendered form. In form mode, every field needs a purpose, bounded type and retention rule. Reject open objects, unbounded free text and fields whose names hide their actual sensitivity.

json 03-qualified-elicitation-contract.json
{
"mode": "form",
"message": "Prepare the approved maintenance window",
"requestedSchema": {
  "type": "object",
  "properties": {
    "change_id": {
      "type": "string",
      "pattern": "^CHG-[0-9]{6}$",
      "maxLength": 10
    },
    "environment": {
      "type": "string",
      "enum": ["staging", "production"]
    },
    "maintenance_window": {
      "type": "string",
      "enum": ["window-a", "window-b"]
    }
  },
  "required": ["change_id", "environment", "maintenance_window"],
  "additionalProperties": false
}
}

Schema validation proves shape, not legitimacy. After acceptance, the wrapper must still verify that the change exists, covers the target, has an open window and that the user has the expected authority. Pass only the minimum back to the model; the server can retain the reference and return a bounded summary instead of the full payload.

For url mode, qualify the allowed origin in the client. Display the domain before opening it, use a short-lived unique request ID, bind completion to the session and original tool call, and reject expired or already consumed completions. A URL placed in the request message instead of the protocol’s URL field must be treated as untrusted text.

Treat accept, decline and cancel as different outcomes

The server must not assume that every response carries data. The result distinguishes acceptance, refusal and cancellation; only accept carries the expected content.

yaml 04-result-policy.yml
result_policy:
accept:
  validate_schema: true
  validate_business_scope: true
  continue_to: preview_only
decline:
  write_action: blocked
  user_message: explain_required_data_without_pressure
  retry: false
cancel:
  write_action: blocked
  preserve_pending_state: false
  retry: explicit_user_request_only

never:
- infer_consent_from_chat_history
- replace_decline_with_default_values
- reuse_content_across_sessions
- convert_form_acceptance_into_tool_approval

A refusal is a user decision, not a transient error. Cancellation may indicate that the interface was closed or the workflow interrupted. In either case, an automatic retry creates pressure, noise and sometimes a collection loop.

Make collection observable without logging its contents

Trace the server, tool, mode, message and schema digests, field names, result action, latency and next step. Do not copy user answers or full URLs into general-purpose logs.

kusto 05-elicitation-risk.kql
AgentElicitation_CL
| where TimeGenerated > ago(24h)
| extend FieldNames = split(FieldNames_s, ",")
| where ResultAction_s == "accept"
| where NextActionRisk_s in ("write", "destructive")
  or SchemaApproved_b == false
  or RequestBindingValid_b == false
| project TimeGenerated,
        TraceId_g,
        ServerLabel_s,
        ToolName_s,
        Mode_s,
        FieldNames,
        ResultAction_s,
        NextAction_s,
        ApprovalState_s
| order by TimeGenerated desc

The table illustrates a custom telemetry schema. The useful signal is an unqualified collection followed by a sensitive action, not the raw number of accepted forms.

Evaluate the client, server and resumption path

A schema unit test does not cover the risk. The canary must exercise the real rendering and the following step:

  • a client without form capability, with no fallback to chat;
  • an extra field, invalid type and text beyond the limit;
  • an attempt to collect a secret through a form;
  • a URL with an unapproved origin, expired request or consumed completion;
  • decline and cancel without automatic retry;
  • valid acceptance followed by a preview and separate approval;
  • a server upgrade that changes the schema without qualification;
  • concurrent sessions whose responses must never cross.
yaml 06-promotion-gates.yml
promotion:
require:
  - client_capability_negotiated
  - schema_digest_allowlisted
  - sensitive_fields_absent_from_form
  - url_origin_allowlisted_when_used
  - request_session_binding_valid
  - decline_and_cancel_stop_workflow
  - write_tool_requires_separate_approval
  - traces_contain_metadata_not_answers

rollback:
- disable_elicitation_capability
- restore_previous_server_version
- keep_write_tools_on_always_approval
- invalidate_pending_elicitation_ids
- replay_affected_sessions_read_only

Enable the capability first on a canary client with a pinned server and a non-writing identity. Promotion requires zero secrets in forms, zero continuation after refusal or cancellation, intact request binding and separate approval for every sensitive action.

Conclusion

MCP elicitation is neither a neutral dialog box nor production approval. It is a server-initiated data exchange in the middle of an agent workflow. Treat it as a versioned contract between server, client, user and the next action.

The decision is direct: promote only bounded schemas, qualified origins and tested resumption paths. Otherwise disable the capability, invalidate pending requests and keep write tools under approval until the complete chain is provable.