Under the hood

A router, a scrubber, a schema, a stamp.

Every AnyImmi AI tool goes through the same four checkpoints. This is what makes it different from a prompt wrapper, and what makes it defensible in a CICC audit.

01

AI Router with CA-region default and three-step fallback.

The router picks a model per tool based on latency budget, output schema, and data residency. Default is Gemini in ca-central-1. If the primary fails, it tries OpenRouter. If that fails, OpenAI. If all three fail, realtime tools hard-error with a retry CTA and async tools queue. No silent template fallbacks, ever.

  • Gemini ca-central-1 — default
  • OpenRouter — fallback 1
  • OpenAI — fallback 2
  • US-region Anthropic — opt-in per firm with audit trail
router · pseudo
export async function route(tool, input, firm) {
  const model = pickModel({
    tool,
    region: firm.dataRegion,     // 'ca-central-1' default
    latency: tool.mode,          // 'realtime' → prefer cached
  });

  try {
    return await callPrimary(model, input);
  } catch {
    try { return await callOpenRouter(input); }
    catch {
      if (tool.mode === 'async') return queue(tool, input);
      throw new RouterFailure({ retryable: true });
    }
  }
}
02

21-field PII scrubber before any non-CA model call.

Any user content destined for a non-CA LLM passes through a deterministic scrubber. Names, UCIs, SINs, passports, addresses, phones, emails, bank accounts, health cards, and 12 more get substituted with tagged placeholders. Extractions stay in the browser so we can rehydrate the final output client-side. Zero regex-only claims — high-stakes tools also take structured entity lists from the caller.

PII Scrubber · 21 categories

What you paste

Dear Officer,

My client Pritam Singh (UCI 8821-4477) was refused on 2026-01-14 per section R216(1)(b). His passport G8741229 was issued in New Delhi. He can be reached at +1-647-555-0144 or pritam.singh@example.com.

He currently resides at 1450 Bathurst St, Toronto ON M5R 3H8 with his spouse Amanpreet Kaur. His SIN is 412-884-009.

What the LLM sees

Dear Officer,

My client Pritam Singh (UCI 8821-4477) was refused on 2026-01-14 per section R216(1)(b). His passport G8741229 was issued in New Delhi. He can be reached at +1-647-555-0144 or pritam.singh@example.com.

He currently resides at 1450 Bathurst St, Toronto ON M5R 3H8 with his spouse Amanpreet Kaur. His SIN is 412-884-009.
Full nameUCIPassport numberDate of birthPhoneEmailAddressSpouse nameSIN+12 more

Scrubbing runs in the router before any US-region model is called. Extractions stay in your browser session so the final output can be re-hydrated client-side.

03

Zod-validated input and output on every tool.

Every tool defines an input schema and an output schema. Inputs validate before we spend a cent on LLM compute. Outputs validate before you see them — if the model drifts, we retry; if it drifts twice, we throw. No half-rendered JSON. No hallucinated fields.

tool · crs-calculator
export const crsCalculator = {
  id: 'crs-calculator',
  inputSchema: CrsInput,       // Zod
  outputSchema: CrsOutput,     // Zod — 1200 max, factor breakdown
  mode: 'realtime',
  creditCost: 0,
  isAiGenerated: false,
  async run(input) {
    return { output: calculateCrs(input), meta: {...} };
  },
};
04

DRAFT stamp, CICC disclaimer, append-only audit log.

Every AI-generated output ships with a non-dismissable DRAFT · FOR RCIC REVIEW stamp and the CICC §8.1 disclaimer stitched into the metadata. Every run writes to an append-only audit log partitioned by month — UPDATE and DELETE are denied at the database level, so it survives a CICC audit.

Retention: 7 years (CICC §8.2) plus 10 years rolling (firm liability window).

SOP Generator · output
tool_id=sop-generator

Statement of Purpose — Master of Data Science, UBC

My decision to pursue the Master of Data Science at the University of British Columbia is not a pivot. It is a continuation of a trajectory that began in my second undergraduate year, when I built a recommendation system for the campus library and

Weak spots flagged · Program rationale could name two UBC faculty. Financial ties paragraph omits spouse income.

CICC §8.1 disclaimer auto-stamped · reviewed by [RCIC name] before sending

The one thing we will not ship

No auto-submit to IRCC. Not now. Not ever.

The Chrome extension autofills IRCC portals. The MCP server answers questions. Neither has a submit tool. That is a CICC red line and a deliberate product decision.

Run the CRS Calculator. See the router in action.

Open CRS Calculator