Runtime
Designing an In-Browser AI Judgment Machine
Report summary
An effective in-browser “Judgment” machine should be built as a jurisdiction-aware legal and ethics triage system for prompts and proposed AI use cases , not as a system that assigns a moral score to the user. That design choice is not just a product preference. It tracks current law and guidance: t
Key topics
- Runtime
- AI
- Agentic Web
- TypeScript
- Rust
- Privacy
- Semantic Systems
- Research Archive
Research provenance
For citation, use the report title and canonical URL. Archival presence does not establish authorship or promote report statements into portfolio evidence.
Source availability: 94 citation markers in the source export have no recoverable source links. Those markers are omitted from this reader; any supplied bibliography and ordinary links remain. Check the original sources before relying on the cited claims.
This page renders the archived Markdown as safe, formatted HTML. It is background research and does not become a portfolio claim without evidence review.
Full report
On this page
Executive summary
An effective in-browser “Judgment” machine should be built as a jurisdiction-aware legal and ethics triage system for prompts and proposed AI use cases, not as a system that assigns a moral score to the user. That design choice is not just a product preference. It tracks current law and guidance: the EU AI Act expressly prohibits certain forms of social scoring and manipulative AI, while GDPR and UK GDPR rules place extra safeguards on solely automated decisions and profiling that have legal or similarly significant effects on people. A product that says “the AI views you as suspicious/untrustworthy” is therefore much harder to justify than one that says “this request appears prohibited in the EU,” “high-risk in employment contexts,” or “allowed with mitigation if notice, human review, and logging are present.”
For default global coverage, the most valuable starting corpus is a core stack of binding law plus authoritative soft law: the EU AI Act; GDPR Article 22; the Council of Europe Framework Convention on AI; China’s generative-AI and synthetic-content labeling rules; South Korea’s AI Framework Act; Colorado’s 2026 automated decision-making law as the most operational U.S. state model; Canada’s Directive on Automated Decision-Making; and then a layer of global and national governance instruments such as the OECD AI Recommendation, UNESCO’s Recommendation on the Ethics of AI, NIST AI RMF and the NIST Generative AI Profile, Japan’s AI Guidelines for Business, Singapore’s model governance frameworks, Australia’s updated AI adoption guidance, and the UK ICO’s AI/data-protection guidance. That stack gives strong coverage of prohibited uses, high-risk decision contexts, transparency duties, human oversight, recourse, privacy, bias, and governance.
The strongest implementation pattern is a hybrid, offline-first browser architecture. Keep the legal corpus, rule tables, and citations locally in SQLite-Wasm or IndexedDB; add a service worker for offline operation; use a deterministic rule engine first; and add small local classifiers or embedding models only for prompt analysis and retrieval. Browser storage and offline operation are mature enough for this pattern: IndexedDB is built for significant structured client-side data and offline querying, service workers are designed to cache assets and enable offline experiences, OPFS is optimized for high-performance in-place writes, and WebAssembly provides a portable execution target for browser-side databases and inference engines.
The core judgment output should therefore be a layered decision, not a single yes/no. The system should return: a primary label; the affected jurisdictions; the triggering legal criteria; the missing mitigations; a confidence score; machine-readable citations; and a counterfactual explanation describing what changes would move the request from prohibited or risky to allowed-with-mitigation. This aligns with the explainability, transparency, recourse, and human-oversight themes that recur across the EU AI Act, the OECD principles, UNESCO’s recommendation, Canada’s directive, and the UK ICO guidance.
Regulatory baseline and source prioritization
The right way to curate a worldwide offline database is to organize sources by authority first, jurisdiction second, and operational relevance third. In practice, that means the system should rank sources in this order: enacted binding law and treaty text; official regulatory guidance implementing that law; official government policy instruments for public-sector AI use; then widely adopted international frameworks. Where unofficial translations exist, they can be stored as convenience material, but the app should mark them as non-authoritative and keep the primary citation linked to the official source.
| Priority | Jurisdiction | Instrument | Why it belongs in the first release |
|---|---|---|---|
| Very high | European Union | AI Act, Regulation (EU) 2024/1689 | Most complete cross-sector AI law; includes prohibited uses, high-risk classifications, provider/deployer duties, transparency, GPAI obligations, and staged applicability. Prohibitions have applied since 2 February 2025; Annex III and Article 50 obligations apply from 2 August 2026. |
| Very high | European Union | GDPR Article 22 and EDPB/ICO profiling guidance | Essential because a “judgment” product can itself become profiling or automated decision-making. Article 22 protects people from solely automated decisions with legal or similarly significant effects; EDPB and ICO guidance explain profiling, fairness, and safeguards. |
| Very high | Council of Europe | Framework Convention on AI, Human Rights, Democracy and the Rule of Law | First binding international treaty in this field; anchors human-rights consistency, transparency, and oversight across the AI lifecycle. Valuable as a cross-border baseline when country-specific AI statutes are incomplete. |
| High | China | Interim Measures for the Management of Generative AI Services plus AI-generated synthetic content labeling rules | Important because China has enforceable generative-AI obligations around lawful content, non-discrimination, registration/filing, and labeling. The primary legal text is on CAC in Chinese; official English summaries also exist through State Council sources. |
| High | South Korea | Framework Act on the Development of AI and the Creation of a Foundation for Trust and transparency guidance | Binding national framework effective 22 January 2026, with transparency duties for high-impact and generative AI clarified by ministry guidance. |
| High | United States | Colorado SB26-189 Automated Decision-Making Technology | As of 2026 this is the most operational U.S. state model for consequential AI decisions, with definitions, notices, human review, record retention, and adverse-outcome rights. It now supersedes Colorado’s earlier SB24-205 structure. |
| High | Canada | Directive on Automated Decision-Making and Algorithmic Impact Assessment | Mature, implementation-oriented framework with impact scoring, transparency, quality, public reporting, and recourse. Particularly useful as a machine-readable design pattern for assessment levels. |
| High | United States | NIST AI RMF 1.0 and NIST Generative AI Profile | Not binding law, but the best operational U.S. trustworthiness/risk-management baseline for mapping criteria and mitigations, especially for generative AI. |
| High | OECD | Recommendation of the Council on AI | Global interoperability layer. Its principles on human rights, transparency, robustness, accountability, and human determination are ideal for cross-jurisdiction fallback logic. |
| High | UNESCO | Recommendation on the Ethics of AI | Broadest human-rights and ethics baseline; especially helpful for fairness, transparency, human oversight, and countries without detailed AI statutes. |
| Medium | Japan | AI Guidelines for Business Ver. 1.2 | Official, updated, practical guidance for business actors, structured around safe and secure use, human-centric principles, and lifecycle governance. |
| Medium | Singapore | Model AI Governance Framework family, including the 2026 Agentic AI framework | Strong source for practical governance patterns, meaningful human accountability, and risk-bounding, especially for agentic or multi-step systems. |
| Medium | Australia | Voluntary AI Safety Standard and Guidance for AI Adoption | Useful for operational controls: accountability, impacts, monitoring, information-sharing, and human control. Particularly handy for mitigation templates in the UI. |
| Medium | United Kingdom | ICO AI and data protection guidance plus the UK’s sectoral AI approach | The UK still relies on a sectoral, regulator-led model rather than an omnibus AI statute, so ICO guidance is a core operational source for fairness, explainability, and automated-decision safeguards. |
| Medium | G7 | Hiroshima AI Process Code of Conduct | Useful international soft-law baseline for advanced AI and model developers; best used for governance and model-level duties rather than user-level legality determinations. |
| Medium | United States | OMB M-25-21 and FTC AI/deception/privacy guidance | Important for public-sector use, procurement, civil-rights/privacy safeguards, deceptive AI claims, privacy promises, and deceptive synthetic content. |
For jurisdictions not expressly selected by the user, the most defensible default is a global baseline mode that applies: binding transnational rules where they are directly relevant; the most protective jurisdictional rule among the jurisdictions the product claims to support; and international guidance where hard law is absent. That is especially important because enacted, cross-sector AI statutes remain uneven outside Europe, China, Korea, and a handful of public-sector or subnational frameworks. UNESCO’s observatory and OECD policy work are useful monitoring layers precisely because many countries are still operating through strategies, ethics codes, public-sector rules, or existing privacy/consumer law rather than comprehensive AI statutes.
Judgment model and legal criteria
A browser-native judgment engine should classify the request and deployment scenario, not the user’s worth or character. The clean abstraction is: “What regulated AI activity is this prompt seeking?” rather than “What kind of person is asking?” That distinction matters because the EU AI Act bans certain social-scoring uses and privacy law adds protections around profiling and significant automated judgments. A safe design can still emit a narrow, internal misuse-intent confidence feature for model routing, but it should never be displayed as a social or reputational score about the person.
The most useful label set is five primary labels plus one uncertainty overlay:
| Label | Meaning | Typical trigger pattern | Default machine action |
|---|---|---|---|
| Illegal or prohibited | Binding law expressly bans the described AI use in at least one supported jurisdiction | EU Article 5 prohibited practices; unlawful impersonation/deceptive deepfakes; unlawful synthetic-content labeling failures in some regimes. | Block; show jurisdictions; recommend redesign |
| Disallowed by product policy | Not universally illegal, but sufficiently dangerous, deceptive, or rights-infringing that the product should refuse | Requests to hide deepfake origin, mass social scoring of people, manipulative or exploitative targeting, requests to evade transparency. | Refuse; show safer alternatives |
| Regulated and high-risk | Potentially lawful only inside a regulated regime with duties and controls | Employment screening, credit scoring, insurance pricing, public-benefit eligibility, law-enforcement profiling, education evaluation. | Require mitigation checklist and human review |
| Allowed with mitigation | Usually lawful if notice, logging, oversight, quality control, privacy safeguards, and, where relevant, labeling are added | Customer-support copilots, drafting assistants, internal summarization, low-stakes copilots. | Approve conditionally; list missing controls |
| Allowed | Low-risk use with no major rights-impacting features and no missing material controls | Brainstorming, style transformation, internal drafting with no personal-data or consequential-decision component. | Approve |
| Uncertain and novel | The prompt is underspecified, cross-border, or maps weakly to stored provisions | New multimodal or agentic use case with missing context. | Downgrade confidence; send to human review |
The legal criteria should be stored as machine-runnable predicates. Each predicate should capture: scope, affected persons, context, regulated domain, risk type, prohibited conduct, required safeguards, and citation payload. A practical criteria taxonomy is shown below.
| Criteria family | Concrete evaluative question | Typical labels | Primary legal anchors |
|---|---|---|---|
| Manipulation and exploitation | Does the request seek subliminal, manipulative, deceptive, or vulnerability-exploiting AI intended to distort decisions and cause harm? | Illegal/prohibited or disallowed | EU AI Act Article 5(a)-(b). |
| Social scoring and reputational ranking | Does the system classify people over time based on social behavior or inferred traits for unrelated or disproportionate treatment? | Illegal/prohibited; also should be product-level disallowed | EU AI Act Article 5(c). |
| Workplace or education emotion inference | Is the system inferring emotions in employment or educational contexts? | Illegal/prohibited in the EU | EU AI Act Article 5(f). |
| Biometric categorization and public-space biometric identification | Does the prompt involve biometric categorization by sensitive traits or real-time remote biometric identification in public spaces? | Prohibited or highly restricted | EU AI Act Article 5(g)-(h); Annex III biometrics. |
| Consequential decisions | Does the system materially affect access to jobs, education, housing, credit, insurance, healthcare, benefits, or legal services? | Regulated/high-risk | EU Annex III; Colorado ADMT; Canada directive. |
| Law-enforcement risk prediction and profiling | Is the prompt about predicting criminality or profiling people for enforcement action? | Prohibited or highly regulated | EU Article 5(d); Annex III law-enforcement items. |
| Transparency and disclosure | Will people know they are interacting with AI, and will synthetic or manipulated content be labeled? | Allowed with mitigation, or disallowed if concealment is explicit | EU Article 50 materials; China labeling rules; Korea transparency guidance; Australia disclosure guidance. |
| Human oversight and recourse | Is there a competent human reviewer, ability to contest, correction path, or appeal after an adverse outcome? | Allowed with mitigation or regulated/high-risk | EU Articles 14, 26, 27; Colorado ADMT; Canada directive. |
| Documentation, quality, and logging | Are risk management, technical documentation, recordkeeping, accuracy, robustness, and monitoring present? | Allowed with mitigation or regulated/high-risk | EU Articles 13, 15, 16; NIST AI RMF; Australia guidance. |
| Privacy, confidentiality, data use | Does the prompt involve personal data, hidden retraining, or uses violating privacy commitments? | Disallowed or allowed with mitigation | GDPR/UK GDPR; FTC privacy guidance; OECD/UNESCO values. |
When jurisdictions conflict, the engine should show a jurisdiction matrix, not flatten them into one answer. For example, a use case may be “prohibited in the EU,” “regulated in Korea,” and “permitted with guidance-based mitigation in Japan.” If the user provides no jurisdiction and the use case touches rights-sensitive domains such as employment, credit, insurance, healthcare, or public services, the safest default is a most-protective supported-jurisdiction result plus a notice that localized legal advice is still required. That approach is consistent with the risk-based logic shared by EU, OECD, NIST, Australia, Japan, Singapore, and Canada.
Data architecture and reasoning workflow
The legal corpus should be modeled as a portable, versioned knowledge base that can run entirely in the browser. A practical design is a primary relational store persisted locally, surrounded by compact auxiliary indices for lexical retrieval, embeddings, and explainability templates. On modern browsers, both IndexedDB and OPFS-backed databases are viable; OPFS is optimized for higher-performance file access, while IndexedDB is widely available for offline structured storage and indexing.
flowchart LR
U[User prompt] --> N[Prompt normalizer]
N --> J[Jurisdiction resolver]
N --> T[Topic and risk tagger]
T --> R1[Deterministic rule engine]
T --> R2[Lexical retriever]
T --> R3[Embedding retriever]
J --> KB[Local legal knowledge base]
R2 --> KB
R3 --> KB
R1 --> S[Scenario evaluator]
KB --> S
S --> E[Explanation composer]
E --> O[Judgment UI]
O --> A[Appeal or human review flow]
A robust minimum schema is:
| Entity or store | Key fields | Purpose | Recommended indexes |
|---|---|---|---|
jurisdiction | jurisdiction_id, name, region, default_language, scope_type | Country/region/state and applicability logic | name, region |
instrument | instrument_id, jurisdiction_id, title, source_type, binding_weight, effective_from, effective_to, official_language, english_available, source_ref | Canonical law/guideline record | (jurisdiction_id, binding_weight), effective_from, full-text on title |
provision | provision_id, instrument_id, citation_label, plain_summary, norm_type, official_text_excerpt, source_ref | Article/section-level unit for retrieval | (instrument_id, norm_type), full-text on plain_summary |
criterion | criterion_id, topic, fact_pattern, severity, default_label, requires_human_review, explain_template_id | Machine-evaluable criterion | topic, severity, full-text on fact_pattern |
provision_criterion_map | map_id, provision_id, criterion_id, applies_if, exceptions_if, mitigation_if, priority_score | Connects law to machine rules | (criterion_id, priority_score), (provision_id) |
taxonomy_tag | tag_id, name, parent_tag_id, synonyms | Shared vocabulary for prompt parsing | full-text on synonyms |
prompt_feature | feature_id, name, feature_type, extractor_rule | Features such as employment, biometric, deepfake, public-interest text, law-enforcement, emotion recognition | name |
precedent_example | example_id, criterion_id, example_prompt, expected_label, rationale_summary | Calibration and UI examples | full-text on example_prompt |
citation_payload | citation_id, source_ref, pinpoint, quote_snippet, trust_level | Fast rendering of citations | (source_ref) |
conflict_rule | conflict_rule_id, jurisdiction_set, resolution_strategy, notes | Cross-border decision logic | full-text on jurisdiction_set |
A useful indexing strategy is hybrid retrieval. The first pass should use deterministic features and lexical search because law is highly phrase-sensitive. The second pass can use embeddings for fuzzy similarity when users describe a scenario indirectly. For offline performance, store: a compact inverted index over normalized keywords and aliases; a full-text or token index over provision summaries; and an optional small embedding index for prompt-to-example matching. This division is well suited to browser capabilities: IndexedDB supports large structured datasets and indexes; SQLite-Wasm and DuckDB-Wasm run locally in WebAssembly; and small transformer-style models can run in-browser, including on WebGPU where available.
An example set of records for the highest-value provisions would look like this:
instrument | provision | criterion | default_label | mitigation_if |
|---|---|---|---|---|
| EU AI Act | Article 5(f) | emotion_recognition_in_workplace_or_education | Illegal/prohibited | None; redesign use case. |
| EU AI Act | Annex III 4(a)-(b) | employment_recruitment_evaluation_or_worker_monitoring | Regulated/high-risk | Documentation, human oversight, transparency, FRIA where applicable. |
| EU AI Act | Article 50 | ai_interaction_or_synthetic_content_without_disclosure | Allowed with mitigation or disallowed if concealment is explicit | Label AI interaction/output; deepfake disclosure; machine-readable marking. |
| Colorado ADMT | Consequential decision definitions and consumer rights | adverse_outcome_in_job_housing_credit_health_or_benefits | Regulated/high-risk | Notice, plain-language description, correction rights, meaningful human review, 3-year records. |
| Canada Directive | Impact assessment, transparency, recourse | administrative_decision_support | Allowed with mitigation or regulated/high-risk | Complete AIA, transparency, quality assurance, recourse. |
| China labeling rules | Synthetic content labeling | publish_synthetic_content_without_labeling | Disallowed/illegal in scope | Add explicit and embedded labeling as required. |
The reasoning workflow should be explicit and inspectable.
flowchart TD
A[Normalize prompt] --> B[Detect language and geography]
B --> C[Extract legal facts]
C --> D[Match topics and entities]
D --> E[Retrieve candidate provisions]
E --> F[Evaluate prohibited-use rules]
F -->|Hit| G[Return prohibited or disallowed]
F -->|No hit| H[Evaluate high-risk and transparency duties]
H --> I[Check mitigations present or missing]
I --> J[Score confidence]
J --> K[Compose explanation and citations]
K --> L[Render result and allow appeal]
A disciplined prompt-analysis pipeline should use these steps:
First, normalize the prompt into a fact schema: action verb, AI capability, target population, domain, stakes, jurisdiction clues, data types, deployment actor, and whether the request is for development, procurement, deployment, or publication. Second, run a rules layer that identifies bright-line triggers such as emotion recognition, social scoring, real-time biometric identification, candidate screening, credit scoring, public-benefit eligibility, deepfake, political persuasion, or law-enforcement profiling. Third, retrieve candidate provisions by keyword and vector similarity. Fourth, apply applicability logic: effective date, territorial scope, sectoral scope, and source authority. Fifth, compute the label. Sixth, generate a confidence score from source authority, specificity of the fact match, and jurisdiction certainty. Seventh, prepare a counterfactual explanation. This sequence maps well onto the NIST AI RMF’s govern-map-measure-manage structure and the explainability/oversight themes in EU, OECD, UNESCO, Singapore, and Canada materials.
A practical confidence model can be expressed as a weighted synthesis:
- Authority score: binding law > official regulator guidance > public-sector policy > international soft law.
- Specificity score: exact bright-line match such as “emotion recognition in workplace” scores much higher than vague similarity to “employee monitoring.”
- Jurisdiction score: explicit jurisdiction or actor context raises confidence; missing geography reduces it.
- Mitigation completeness score: explicit human review, notice, logging, appeal, and labeling increase the probability of “allowed with mitigation” rather than “risky.”
- Novelty penalty: agentic, multimodal, or unusual scenarios without close criterion matches should default toward “uncertain/human review.”
For ambiguous or novel cases, the system should never hallucinate a hard legal conclusion. It should instead say: “No bright-line prohibition matched; closest concerns are X, Y, Z; confidence is low because jurisdiction or deployment context is unclear.” It should then fall back to the global governance layer from OECD, UNESCO, NIST, Singapore, Australia, and Canada. That gives the user a practical answer without pretending a legal certainty that the sources do not support.
Product experience, privacy, and governance controls
The UI should present an interactive judgment card with six visible blocks: label, jurisdiction(s) affected, why this triggered, what would fix it, confidence, and citations. The user should be able to expand the rationale from a one-sentence answer into a structured trace showing matched facts, matched provisions, exceptions considered, and missing mitigations. This aligns well with the transparency and explanation duties reflected in EU Article 50, the UK ICO’s explaining-AI guidance, and Canada’s emphasis on transparency and recourse.
A recommended layout is:
| UI element | What it should show | Why it matters |
|---|---|---|
| Judgment banner | Prohibited in EU, High-risk in employment, Allowed with mitigation, etc. | Users need a fast top-line reading before legal detail. |
| Jurisdiction chips | EU, China, Colorado, Canada, Japan, etc. | Avoids the false impression of a single worldwide rule. |
| Triggered facts | “Employment hiring,” “emotion recognition,” “deepfake publication,” “public-benefit eligibility” | Makes the model inspectable and appealable. |
| Missing mitigations | Human review, notice, risk assessment, logging, labeling, recourse | Converts legal analysis into product decisions. |
| Confidence and uncertainty note | e.g., 0.87 high confidence; or 0.41 low confidence because jurisdiction unspecified | Prevents overclaiming and improves trust. |
| Citation drawer | Official titles, article numbers, short snippets | Essential for rigorous, auditable output. |
The product should also have an appeal or override flow. A user who disputes a result should be able to: choose or change jurisdiction; supply missing context; indicate whether the use is internal, public, or government-facing; and request human review. The system should then recompute the result and preserve the original and revised traces side by side. This pattern is consistent with the recourse theme in Canada’s directive, the human-review rights in Colorado’s ADMT law, and the broader fairness logic in GDPR/UK GDPR guidance.
Because the user specifically wants a machine that expresses how the AI “views” the prompt, the privacy and consent language must be unusually careful. The product should disclose, in plain language:
| Notice | Recommended text |
|---|---|
| Decision object | “This tool evaluates the request and proposed AI use case, not your character, morality, reputation, or social value.” |
| Profiling limit | “This tool does not create a ‘trust score’ or social score about you.” |
| Legal disclaimer | “This is legal and ethics triage, not legal advice.” |
| Processing mode | “By default, analysis runs locally in your browser.” |
| Data use | “Prompts are not uploaded unless you explicitly enable remote analysis.” |
| Control | “You can delete all local history and cached models at any time.” |
That framing is not merely defensive drafting. It is substantively supported by the legal context: the EU prohibits AI social scoring, while GDPR and UK GDPR rules impose extra protection where profiling or automated significant decisions are involved. FTC guidance also cautions that privacy commitments and confidential data promises remain enforceable, even in AI settings.
A strong default compliance and retention policy is:
| Policy area | Recommended product rule | Source rationale |
|---|---|---|
| Prompt retention | Default to no server retention; local-only unless user opts in | Privacy/confidentiality commitments remain enforceable; local processing minimizes exposure. |
| Local storage | Store legal corpus separately from user activity; let users clear either independently | Browser storage APIs support persistent offline data, but user control is important. |
| Audit logs | If enabled, keep short-lived local logs for reproducibility; rotate and export/delete | Colorado and EU compliance patterns emphasize recordkeeping, but privacy law disfavors unnecessary retention. |
| Human review | Require human override for adverse or consequential judgments about rights-sensitive scenarios | EU human oversight, Colorado meaningful human review, Canadian recourse. |
| Disclosure | Surface AI interaction and synthetic-content disclosure requirements prominently | EU Article 50, China labeling, Korea transparency guidance, Australia disclosure guidance. |
| Security | Use signed DB bundles, integrity checks, strict CSP, isolated workers for model/runtime code, and least-privilege network access | WebAssembly has a browser security model; service workers and local storage should be tightly controlled. |
Implementation options, performance, and roadmap
The best fit stack is an offline-first progressive web app with worker-based storage and inference. Service workers provide caching and offline bootstrapping; IndexedDB or OPFS-backed SQLite provides local persistence; WebAssembly lets the browser run local databases and model runtimes; and ONNX Runtime Web or Transformers.js can handle small classification and embedding tasks locally.
| Stack option | Strengths | Weaknesses | Best use |
|---|---|---|---|
| Rules + local DB only | Fastest, easiest to audit, smallest footprint | Weak on fuzzy/novel prompts | First production release |
| Rules + local embeddings/classifiers | Better retrieval and paraphrase handling; still private/offline | Larger bundle; device variability | Recommended default for mature release |
| Local mini-LLM in browser | Best nuanced explanation without network | Large downloads, inconsistent mobile performance, WebGPU dependence | Power-user or desktop mode |
| Remote LLM fallback | Strongest language reasoning, smaller local bundle | Privacy/trust concerns, network dependency, retention/compliance complexity | Optional opt-in only |
The browser platform supports these choices well. IndexedDB is intended for significant structured client-side data and offline queries; service workers are specifically meant to intercept requests and enable effective offline experiences; OPFS provides high-performance origin-private storage and synchronous access handles in dedicated workers; WebAssembly is a portable compilation target for browser execution; DuckDB-Wasm and SQLite-Wasm run analytical or relational workloads locally; ONNX Runtime Web provides in-browser inference; and Transformers.js supports browser-side model pipelines with optional WebGPU acceleration.
For broad deployment, I would recommend this stack:
- Frontend: React, Svelte, or plain TypeScript PWA.
- Storage: SQLite-Wasm on OPFS where available; IndexedDB fallback.
- Inference: deterministic rule engine first; small ONNX or Transformers.js models for feature extraction and retrieval.
- Runtime isolation: Web Workers for retrieval and inference; service worker for offline assets.
- Update model: signed policy-pack bundles with semantic versioning and differential updates.
- Remote mode: optional, explicit opt-in, zero-retention configuration, and send normalized facts instead of the raw prompt where possible.
Performance estimates depend heavily on corpus size and model choice, but the following are realistic engineering targets for a first serious release. These are implementation estimates rather than published benchmarks:
| Operation | Recommended target |
|---|---|
| App shell warm start | under 500 ms on desktop, under 1.5 s on modern mobile |
| Policy-pack cold load | about 2–5 s desktop, 4–10 s mobile for a 20–100 MB compressed bundle |
| Pure rule + lexical lookup | 20–100 ms after warm cache |
| Small embedding/classifier pass | 50–250 ms desktop, 150–800 ms mobile |
| Full judgment rendering with citations | under 1 s desktop for common cases |
| Local mini-LLM explanation mode | desktop-only by default; expect much higher download size and latency |
Those targets are achievable because the browser can store and query sizeable local datasets, cache assets for offline use, and run local Wasm/ONNX workloads. The main limiting factors are storage quotas, model size, WebGPU availability, and device thermal/memory constraints.
A practical roadmap is:
| Milestone | Scope | Estimated effort |
|---|---|---|
| Foundation | Legal source inventory, schema, citation pipeline, manual criteria authoring for EU/US/Canada/OECD/UNESCO | 4–6 weeks |
| Offline MVP | IndexedDB or SQLite-Wasm corpus, rule engine, lexical retrieval, judgment UI, citation drawer, no remote calls | 5–7 weeks |
| Mitigation-aware release | Human-review flow, jurisdiction selector, appeal flow, audit/export/delete, signed updates | 4–6 weeks |
| Hybrid intelligence | Local feature extraction, embeddings, confidence scoring, example matching, calibration set | 5–8 weeks |
| Expanded coverage | China, Japan, Korea, Singapore, Australia, UK, G7 packs; conflict rules | 4–8 weeks |
| Hardening | Security review, privacy review, accessibility, red-team testing, legal QA, governance playbooks | 4–6 weeks |
For a focused team, that implies roughly 22–41 weeks to reach a strong, broad-coverage product, with a credible MVP in roughly 9–13 weeks. The timeline is driven less by UI coding than by legal curation, criteria authoring, and validation against edge cases.
Worked judgments, risks, and limitations
The examples below assume global baseline mode with no user-specified jurisdiction. In that mode, the system should show the most restrictive supported jurisdictions and also distinguish between “binding prohibition” and “governance risk.”
Worked judgment for workplace emotion screening
Prompt
“Build an AI that reads applicants’ facial expressions during interviews and automatically rejects low-confidence candidates.”
Recommended judgment
- Primary label: Illegal or prohibited in the EU; disallowed by product policy globally.
- Confidence: High.
- Why: The request explicitly involves emotion inference in a workplace context and automated hiring evaluation. EU Article 5 prohibits using AI to infer emotions in the workplace, except for medical or safety reasons. Separately, Annex III treats recruitment, candidate evaluation, and workplace performance/behavior monitoring as high-risk. Colorado’s ADMT law also treats employment-related consequential decisions as covered. Canada’s public-sector hiring guidance likewise routes AI-supported staffing through the automated-decision framework.
Step-by-step machine trace
| Step | Output |
|---|---|
| Fact extraction | domain=employment, population=job applicants, capability=emotion recognition, decision=adverse hiring outcome, human_review=none stated |
| Bright-line rule check | Match to EU Article 5(f): emotion inference in workplace. |
| High-risk check | Match to Annex III 4(a): recruitment/selection/evaluate candidates. |
| Rights-sensitive check | Employment is a consequential decision area in Colorado ADMT. |
| Result | Return prohibited/disallowed; no mitigation path for the emotion-recognition feature itself |
Counterfactual explanation
“If you remove emotion inference entirely and instead use AI only to assist with structured scheduling or draft interviewer notes, while keeping a human decision-maker and clear notices, the request could move toward ‘allowed with mitigation.’” That shift aligns with the contrast between prohibited emotion inference and ordinary low-risk or mitigated assistance.
Worked judgment for public-space police facial recognition
Prompt
“Use real-time facial recognition in a public square so police can identify wanted suspects automatically.”
Recommended judgment
- Primary label: Prohibited or extremely restricted in the EU; globally high-risk and rights-sensitive.
- Confidence: High.
- Why: EU Article 5 prohibits real-time remote biometric identification in publicly accessible spaces for law-enforcement purposes except for narrow exceptions tied to victims, imminent threats, or serious crimes, plus strict authorization and safeguards. Biometrics are also listed in Annex III as high-risk AI.
Step-by-step machine trace
| Step | Output |
|---|---|
| Fact extraction | biometric=remote identification, space=public, actor=law enforcement, mode=real-time |
| Bright-line rule check | Match to EU Article 5(h). |
| Exception analysis | Prompt does not specify a narrow Article 5(h) exception, prior authorization, or proportionality limits. |
| High-risk check | Biometrics category in Annex III. |
| Result | Return prohibited/strictly restricted with low tolerance for ambiguity |
Counterfactual explanation
“If the use case were a non-public, voluntary identity verification flow for a named user proving they are who they claim to be, the legal posture would be materially different from real-time public-space police identification.” That distinction appears directly in Annex III’s carve-out for biometric verification used solely to confirm a claimed identity.
Worked judgment for undisclosed deepfake political content
Prompt
“Generate a video of a candidate saying something they never said, and make it realistic enough that people won’t know it’s AI.”
Recommended judgment
- Primary label: Disallowed by product policy; likely unlawful or non-compliant in multiple jurisdictions.
- Confidence: High.
- Why: The prompt explicitly seeks deceptive synthetic content and concealment. EU transparency rules require AI-generated or manipulated content to be marked and deepfakes to be disclosed once Article 50 applies from 2 August 2026. The EU also classifies certain AI systems intended to influence voting behavior as high-risk. China now requires labeling of AI-generated synthetic content, including detection and explicit indication regimes. FTC materials also make clear that deceptive AI-generated content and false claims can trigger enforcement, and the agency has acted against AI-enabled deception.
Step-by-step machine trace
| Step | Output |
|---|---|
| Fact extraction | synthetic_video=yes, impersonation=public figure, intent=conceal AI origin, context=political persuasion |
| Transparency check | Explicit conflict with disclosure/labelling duties. |
| Democratic-process check | Possible Annex III 8(b) issue if intended to influence voting behavior. |
| Deception check | Matches product-level disallow rule for deceptive synthetic impersonation. FTC enforcement posture reinforces this. |
| Result | Refuse; recommend lawful satire, disclosed parody, or clearly labeled synthetic demonstration instead |
Counterfactual explanation
“A clearly labeled fictional or satirical example that does not mislead viewers about the real person could be treated differently, though local election and defamation laws would still need review.” The key distinction is disclosure and non-deceptive presentation.
Worked judgment for customer-support copilot
Prompt
“Use an LLM to summarize customer support tickets and draft replies, but require human approval before any message is sent.”
Recommended judgment
- Primary label: Allowed with mitigation.
- Confidence: Medium-high.
- Why: This is not a bright-line prohibited use and does not obviously involve a consequential decision. It does, however, implicate accuracy, confidentiality, logging, human control, and transparency. NIST AI RMF and the Generative AI Profile emphasize governance, content provenance, pre-deployment testing, and incident handling; Japan, Australia, Singapore, and OECD instruments all point toward risk-based governance, accountability, and human control. FTC privacy guidance matters if customer data might be reused beyond promised purposes.
Step-by-step machine trace
| Step | Output |
|---|---|
| Fact extraction | domain=customer support, human_approval=yes, external publication=no, consequential_decision=no clear match |
| Prohibited-use check | No bright-line prohibition matched |
| Governance check | Accuracy, privacy, confidentiality, logging, and escalation controls required. |
| Result | Allowed with mitigation |
| Required controls | Human approval on every outbound message; prompt/response logging locally or per policy; customer-data segregation; notice where users interact with AI directly; retention limits; incident reporting path. |
Risks, limitations, and mitigations
No matter how carefully built, a judgment machine of this kind will face hard limits.
| Risk | Why it is real | Mitigation |
|---|---|---|
| False positives | Legal texts are context-dependent; broad lexical triggers can over-block | Use bright-line rules only for genuine prohibitions; otherwise emit “regulated/high-risk” or “uncertain” and show why |
| False negatives | Users rephrase harmful scenarios indirectly | Add local embeddings/example matching and maintain red-team prompt sets |
| Jurisdiction conflict | Different countries regulate the same use differently | Always render jurisdiction chips and a conflict matrix instead of one universal answer |
| Profiling liability | The product itself may become an automated judgment about people | Evaluate the prompt/use case, not the user; no trust score or social score; keep human override |
| Source drift | AI rules change quickly, especially implementation guidance and effective dates | Signed policy-pack updates, effectivity dates in schema, visible “last updated” field |
| Liability and overreliance | Users may mistake triage for legal advice | Prominent notice, confidence score, citations, and escalation path for counsel |
| Model privacy leakage | Remote inference can expose prompts or hidden personal data | Default local processing; remote mode opt-in; minimize data sent; honor privacy commitments |
| Adversarial prompting | Users may try to manipulate the classifier or hide intent | Keep a rules-first layer; track ambiguity; flag evasion language; use abuse red-teaming |
| Scalability of legal curation | Global coverage is labor-intensive | Start with a curated “core jurisdictions” pack, then expand with a versioned ingestion process |
These mitigations are consistent with the governance and trustworthiness themes across NIST, OECD, UNESCO, Australia, Singapore, Canada, the UK ICO, and the EU AI Act.
The bottom line is that the strongest version of this product is not a browser toy that “judges the user.” It is an offline-capable, citation-backed, jurisdiction-aware legal-and-ethics reasoning interface for AI prompts and deployment scenarios. If built that way, it can be rigorous, useful, and much easier to defend from a compliance and product-trust standpoint.