Skip to content

Main content

Prompt Placeholder Escape

Escape literal braces for a Python-style brace-format template by doubling both brace characters; no prompt is sent or evaluated.

Loading tool…

Description

Double literal braces in supplied prompt text.

Model and prompt records distinguish token indices, offset units, reserved capacity, code scales and numeric representations. A common softmax shift is mathematically invariant but can alter rounded inputs. Literal brace doubling and citation tokens are format conventions rather than universal template or evidence validation.

Double literal braces in supplied prompt text.

When to use this tool

Use Prompt Placeholder Escape when you already have literalText and need to double literal braces in supplied prompt text.

How to use the tool and how it works

  1. Enter literalText. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read escapedText. Use the output convention below.

Replace every { with {{ and every } with }} without interpreting existing pairs.1

Input fieldMeaning and unitsAccepted input
literalTextLiteral TextRequired. Text; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
escapedTextEvery literal brace doubled; existing pairs are doubled again, so repeated escaping changes the text.Required. Text; maximum UTF-16 length 8192.
json
{
  "input": {
    "literalText": "Use {name} literally"
  },
  "output": {
    "escapedText": "Use {{name}} literally"
  }
}

Limitations and assumptions

  • This convention suits template systems that escape braces by doubling. It is not universal template escaping, idempotent processing, HTML escaping or protection against instruction injection.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.

Alternative or Complementary methods

Use the complete tokenizer, template, model contract and evaluation method. Verify actual capacity, vocabulary and numerical behavior when supplied budgets, local masks or representation checks cannot establish correct model operation.

References

  1. Calculation and input contract: artificial-intelligence/prompt-placeholder-escape — tool.io

Similar or alternative tools