Skip to main content
Batoi AIF Docs

Gateway and Policy

Use the AIF gateway as the governed execution boundary.

Version Foundation release Early foundation work Reviewed Jul 21, 2026 Next review Sep 21, 2026

Owner: Batoi Engineering Reviewed by: Batoi AIF Maintainers Source revision: cd680e8

AIF is the public engineering framework. For the managed intelligence capability used across supported Platform and Flex workflows, see Batoi Intelligence.
Browse Batoi AIF Documentation Gateway and Policy

Gateway and Policy

AifGateway is the application-facing execution boundary for inference, streaming, embeddings, moderation, retrieval, and tools. RuntimeMode::Development supports local evaluation. RuntimeMode::Governed fails closed unless trusted caller context, policy enforcement, and audit persistence are configured.

Gateway Responsibilities

  • validate runtime dependencies and request input
  • resolve a capable provider and immutable approved prompt
  • evaluate operation-aware policy
  • enforce obligations such as redaction or human review
  • execute the provider, retrieval, or permission-aware tool operation
  • run pre- and post-execution evaluators
  • attempt one correlated terminal audit record
  • emit vendor-neutral operational metrics

Policy Decisions

Policy should be able to return clear decisions:

DecisionMeaning
allowContinue through the governed lifecycle.
denyStop before provider or tool side effects.
reviewPersist a pending review and stop before execution.

Policy obligations may transform a request, such as redacting classified fields. AIF rejects an unsupported or unenforceable obligation rather than ignoring it.

Example Policy Questions

  • Is this user allowed to run this AI capability?
  • Is this provider allowed for this workspace?
  • Does the prompt contain sensitive data?
  • Does the task require human review?
  • Is the output permitted to enter a workflow automatically?

Keep these questions in policy contracts, not scattered through UI pages. Use OperationAwarePolicyEngineInterface when the decision must distinguish inference, embedding, moderation, retrieval, streaming, or tool execution.

See Review Workflows for approval and replay-protection behavior.