apache/incubator-seata · warning · IllegalArgumentException

Confirmation string must explicitly contain '确认' or 'confirm

Error message

Confirmation string must explicitly contain '确认' or 'confirm' and repeat the modification content. This must come from the user.

What it means

Thrown by Seata MCP ModifyConfirmTools when the user confirmation string is present but does not contain either '确认' (Chinese) or 'confirm' (English). The check is a deliberate keyword gate ensuring the string reads as an explicit confirmation of the modification, and the parameter description forbids the LLM from fabricating it.

Source

Thrown at console/src/main/java/org/apache/seata/mcp/tools/ModifyConfirmTools.java:52

    private final ModifyConfirmService modifyConfirmService;

    public ModifyConfirmTools(ModifyConfirmService modifyConfirmService) {
        this.modifyConfirmService = modifyConfirmService;
    }

    @McpTool(
            description = "Before modifying (update or delete) a transaction or lock, the user MUST manually confirm."
                    + "You are NOT allowed to fabricate or auto-confirm on behalf of the user.")
    public Map<String, String> confirmAndGetKey(
            @McpToolParam(
                            description =
                                    "The confirmation string provided by the USER (not generated by the LLM).The content must repeat the modification action clearly.")
                    String userInputStr) {
        if (StringUtils.isBlank(userInputStr)) {
            throw new IllegalArgumentException("User confirmation string is required.");
        }
        if (!userInputStr.contains("确认") && !userInputStr.contains("confirm")) {
            throw new IllegalArgumentException(
                    "Confirmation string must explicitly contain '确认' or 'confirm' and repeat the modification content. This must come from the user.");
        }
        Map<String, String> keyMap = modifyConfirmService.confirmAndGetKey();
        LOGGER.info("the user obtains a modify key:{}", keyMap.get("modify_key"));
        return keyMap;
    }
}

View on GitHub (pinned to e01f97c6db)

Solutions

  1. Re-run the tool with a string that literally contains 'confirm' or '确认', e.g. 'confirm delete global transaction 192.168.1.1:8091:123456'.
  2. Instruct the MCP client/LLM prompt to echo the user's exact confirmation text, never a summary.
  3. For non-EN/ZH deployments, upstream-patch the keyword set or standardize on the English keyword in team runbooks.

Example fix

// before
confirmAndGetKey("yes, do it");
// after
confirmAndGetKey("confirm: delete global transaction 192.168.1.1:8091:123456");
Defensive patterns

Strategy: validation

Validate before calling

String CONFIRM_RE = "(?i).*(confirm|确认).*";
if (!userInputStr.matches(CONFIRM_RE)) {
    return "Include the literal word 'confirm' (or '确认') and restate the action.";
}

Type guard

boolean isExplicitConfirmation(String s) {
    return s != null && (s.toLowerCase().contains("confirm") || s.contains("确认"));
}

Prevention

When it happens

Trigger: confirmAndGetKey is called with text like 'yes', 'ok', 'go ahead', 'sure', or a paraphrase in another language that lacks the literal substrings 'confirm' or '确认'.

Common situations: Non-English/non-Chinese users typing 'si', 'ja', '확인'; LLM paraphrasing the user's intent instead of forwarding their literal words; users pasting only the transaction description without the word confirm.

Related errors


AI-assisted analysis of apache/incubator-seata@e01f97c6db (2026-08-14). Data as JSON: /api/errors/093628d8c78492f6. Report an issue: GitHub.