agencyguardrailOpen Form Guard
Back to the platform INTEGRATION GUIDE

A guardrail for your
existing forms.

Connect your server, preserve your delivery queue, and start in observation mode.

1. Create a source

Sign in, open Form Guard and choose Connect a site. Add a domain and an accurate description of the business. Copy the source key shown once and store it as a server environment secret. Use one source per client website.

2. Save, then submit

Keep your original form validation, rate limits and bot controls. Save the original submission in your own durable retry queue before calling this API. Use a stable, unique identifier from 8 to 100 characters. Repeating the same identifier and content does not create a duplicate.

const response = await fetch(process.env.GUARDRAIL_URL + "/api/forms/submit", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    Authorization: "Bearer " + process.env.FORM_GUARD_KEY,
  },
  body: JSON.stringify({
    idempotencyKey: savedSubmission.id,
    name: savedSubmission.name,
    email: savedSubmission.email,
    message: savedSubmission.message,
    honeypot: savedSubmission.website || "",
    isTest: false,
  }),
});
if (!response.ok) {
  // Keep the original in YOUR durable queue. Retry with the same ID.
  throw new Error("Submission requires retry: " + response.status);
}
const decision = await response.json();
// Every accepted response includes an ID for the saved submission.
// Never show internal spam judgments to the person filling the form.

Messages may contain up to 12,000 characters. Source intake is limited to 60 new submissions per minute. Retry transient failures and HTTP 429 after at least one minute. A 409 with changed content requires a new identifier. Never silently discard a lead on an API error.

3. Handle every disposition

DispositionMeaning
observedObservation mode. Continue the existing delivery workflow regardless of the proposed classification.
acceptedA relevant inquiry is ready for delivery.
reviewSaved for review. The decision is uncertain, unavailable, or the usage allowance is exhausted.
quarantinedPreserved suspected spam or malicious content. A reviewer can release it.
releasedA person reviewed the submission and marked it ready for delivery.

Either deliver observed and accepted submissions directly and acknowledge them, or use the queue worker below for all delivery. Avoid running both paths without shared deduplication.

4. Deliver released leads

The delivery API returns up to 50 pending observed, accepted or released submissions, oldest first. Send each to your existing destination, then acknowledge it. Delivery is at least once, so your destination must deduplicate on the submission ID. A release does not send an email by itself.

// Run from a scheduled SERVER worker. No source keys in the browser.
const headers = { Authorization: "Bearer " + process.env.FORM_GUARD_KEY };
const result = await fetch(process.env.GUARDRAIL_URL + "/api/forms/deliveries", {
  headers, cache: "no-store",
});
if (!result.ok) throw new Error("Delivery queue unavailable");
const { submissions } = await result.json();
for (const submission of submissions) {
  // Test records are excluded. Use ?test=true with a separate test worker.
  // Implement your CRM/email delivery with submission.id as its dedupe key.
  await deliverToYourCRM(submission, { idempotencyKey: submission.id });
  const ack = await fetch(process.env.GUARDRAIL_URL + "/api/forms/deliveries", {
    method: "PATCH",
    headers: { ...headers, "Content-Type": "application/json" },
    body: JSON.stringify({ ids: [submission.id] }),
  });
  if (!ack.ok) throw new Error("Retry acknowledgement on the next run");
}

The destination function in this example is yours to implement. Treat message content as untrusted text, escape it in HTML emails, and do not execute attachments or links. Test records should go to a separate destination.

5. Review before enabling protection

Collect a representative labeled set, including real inquiries, nonnative writing, brief messages, existing customer complaints and spam. Review false positives and uncertain outcomes. Only enable protection when your client’s workflow, delivery retries and lead recovery have passed your checks.

AI assessments, rule decisions and service outages are labeled separately. Model confidence is not an independently measured accuracy guarantee.

Connect your first source