Source: docs/public/integration/prompt-integration-agent-prompt.md
Prompts for AI agents
Use these two steps to prepare and integrate a browser form. Read the
browser contract first. This is not a chat or a
server-to-server API.
Prompt 1 — Prepare the contract
Give the agent the existing form and this prompt:
Analizá el formulario y devolvé un único objeto JSON con tres campos:
1. input_schema: los datos no sensibles que necesita el análisis.
2. output_schema: la estructura exacta que la interfaz va a mostrar.
3. prompt: instrucciones para generar exclusivamente ese objeto de salida.
No incluyas nombres de personas, emails, teléfonos, credenciales ni otros
datos personales. Si el formulario los recoge, mantenelos fuera de Forgium.
Ambos schemas deben tener raíz type: "object", additionalProperties: false,
properties y required. Todo string, incluso dentro de enum, necesita maxLength.
Todo array necesita items y maxItems. minLength y minItems son opcionales.
Se admiten objetos anidados, boolean, integer/number con minimum/maximum y
enum de strings. No uses $ref, oneOf, anyOf, allOf, format ni pattern.
Límites: profundidad máxima 8, hasta 100 propiedades por objeto, maxItems
hasta 100 y maxLength hasta 10000. No son objetivos de tamaño: usá schemas
pequeños. La salida completa dispone de 2048 tokens, incluyendo el JSON.
Preferí 1–3 hallazgos breves por categoría, no informes largos. Los máximos
por campo no garantizan que llenar todos los campos quepa en ese presupuesto.
Alineá el prompt con output_schema: mismas claves, tipos y cantidades.
Permití listas vacías si no hay evidencia; nunca inventes para completar mínimos.
Basate solo en el input y pedí texto plano, sin Markdown ni HTML.
Example handoff to the operator
This complete example has both bounded schemas. The operator supplies the
approved name and origin; creation is performed privately, not by the browser.
{
"input_schema": {
"type": "object",
"additionalProperties": false,
"required": ["business_context"],
"properties": {
"business_context": { "type": "string", "minLength": 20, "maxLength": 2000 }
}
},
"output_schema": {
"type": "object",
"additionalProperties": false,
"required": ["resumen", "prioridades"],
"properties": {
"resumen": { "type": "string", "maxLength": 400 },
"prioridades": {
"type": "array", "maxItems": 3,
"items": { "type": "string", "maxLength": 160 }
}
}
},
"prompt": "Analizá el contexto recibido sin inventar hechos. Devolvé solo JSON con resumen breve y prioridades: de cero a tres acciones concretas en frases cortas. Usá listas vacías si no hay evidencia. Sin Markdown ni HTML."
}
A successful manifest validation checks structure, not model reliability.
Before accepting the integration, the operator must verify a real inference
with representative synthetic input and validate the result against the
approved output_schema. Do not use real contact data for acceptance.
Prompt 2 — Integrate the approved bundle
Attach the complete bundle, including input_schema and output_schema,
and the existing form. Replace the placeholders before sending this prompt:
Integrá este formulario con Forgium Prompt Integrations usando el bundle adjunto.
Leé https://docs.forgium.dev/docs/integration/prompt-integrations
Origen autorizado: <origin>
Endpoint: <endpoint>
Turnstile sitekey: <turnstile_sitekey>
Turnstile action: <turnstile_action>
Usá exclusivamente input_schema y output_schema del bundle. No adivines claves
ni agregues datos personales. Construí la UI para body.data según output_schema.
Hacé el POST desde el navegador, no desde un proxy/backend. No uses API keys
ni secretos. Mandá solo { input: <datos válidos>, turnstile_token: <token nuevo> }.
Cargá Turnstile antes de renderizarlo y configurá sitekey Y action. Evitá envíos
sin token o duplicados; reseteá el widget después de cada intento, incluso errores.
Usá timeout de 30 segundos, estados de carga/error y renderizado como texto,
nunca innerHTML. No reintentes automáticamente. Respetá Retry-After para 429.
Leé error.message para conocer la causa concreta y la acción recomendada.
VALIDATION_ERROR indica el primer campo/regla o el límite de bytes de entrada.
Los códigos son categorías estables; no compares el texto exacto del mensaje.
MODEL_OUTPUT_TRUNCATED y MODEL_OUTPUT_INVALID son fallos del lado de Forgium:
informá código, mensaje, hora UTC y X-Trace-Id enviado al operador. No cambies el
contrato ni el formulario para intentar arreglar la generación del servidor.
Verificá una solicitud válida, el rechazo de datos fuera de schema y el manejo
de errores. No declares E2E completo con mocks: verificá navegador, Turnstile
y resultado real desde el origen aprobado. No despliegues sin autorización.
Older bundles may lack output_schema. Ask the operator for the approved
response schema; do not infer it from a single response or from the input fields.
Use a new Turnstile token after any failure; a private/incognito window does
not repair an output-generation error.