Everything above this page describes the pipeline in the abstract. This page runs
one concrete request through it, layer by layer, so you can see exactly
what data exists at each stage — and exactly where authorization is checked.
Want to run this instead of reading it? The exact "top supplier" request
on this page — plus the case where candidates tie and Foundgine asks the agent to choose
instead of guessing — is wired into a reproducible, seeded benchmark against a real
PostgreSQL database: see the
Supply Chain E2E page for the
working code.
The request
"Show me overdue purchase orders from our top supplier in Texas, and how many days late
each one is."
This sentence is typed by a purchasing manager into an AI agent connected to a Supply
Chain application through Foundgine.MCP. It is deliberately imprecise:
"top supplier" is not a database key, and "overdue" is
not a column. Foundgine's job is to turn that sentence into one authorized,
provider-independent execution — without ever letting the model write SQL or decide what
the caller is allowed to see.
DomainSupply Chain sample (PurchaseOrder, Supplier)CallerAI agent acting for a purchasing-manager user, tenant-7
1→2→3→4→5→6→7→8→9→10→11→12
1
Step 1 · Caller
The raw sentence arrives
Untrusted caller → Foundgine
Foundgine treats the agent exactly like an API client or a GraphQL client: an
untrusted caller. Nothing about the sentence is trusted yet — not the words, not the
implied filters, not the fact that it came from an internal tool.
Incoming payload
{
"caller": "ai-agent",
"channel": "mcp",
"actor": { "id": "agent-42", "tenantId": "tenant-7" },
"message": "Show me overdue purchase orders from
our top supplier in Texas, and how many
days late each one is."
}
The agent calls foundgine_capabilities to see what it may ask for —
that description is advisory, never a credential (see
AI agents). It then emits structured intent.
Two words in the sentence stay unresolved on purpose:
"top supplier" and "overdue" are recorded as language, not
as IDs or booleans, because the model does not get to decide what those mean.
Structured intent → Semantic Model (Foundgine.Semantics)
purchaseOrder, supplier and the
Supplier relationship are looked up against the application-defined
semantic model, not against database tables. "overdue" is resolved here
too: the model defines it as a named predicate, not something the caller can
redefine.
The request becomes one graph, including the ambiguous part
Semantic Model → Semantic Operation Graph
Foundgine builds one graph for the whole request. Because
"top supplier" cannot be resolved from the semantic model alone, the
graph carries an explicit candidate node that must be settled by retrieval
before the rest of the graph can be authorized or planned.
"Top supplier in Texas" gets an answer — but no authority
Candidate node → Ranked candidates + evidence
A Foundgine.Sql retrieval strategy (relational lookup, ranked by total
order value) resolves the candidate node to a real supplier. This step only produces
candidates and evidence. It cannot grant access to anything — the result still has
to pass through resolution and authorization below.
The candidate supplier is bound into the graph, and Foundgine validates that every
field, relationship and predicate the request touches is real, typed and
traversable. If "top supplier" had matched nothing, or matched
ambiguously, resolution would stop here and tell the agent its own words were
ambiguous — it would not guess (see
Grounding decisions).
The decision that everything downstream must honor
Resolved request → Authorized request + evidence
This is where "is this caller allowed to do this" gets answered — once, centrally,
regardless of which tool or transport the agent used. Here it constrains the request
to the caller's tenant and strips a field the requester's role cannot see.
Authorized graph → Provider-independent plan + AuthorizationBinding
Foundgine turns the authorized graph into a logical plan that still knows nothing
about PostgreSQL. Critically, the plan carries an
AuthorizationBinding — a fingerprint of the step 7 decision. Any later
optimization can change the plan's shape, but it cannot change what was authorized.
The controlled intermediate form at the provider boundary
Bound plan → ExecutionIR
Foundgine.Execution lowers the plan into ExecutionIR: an
explicit, inspectable operator tree that still carries the authorization binding
forward. This is the last representation before any provider-specific syntax
appears.
Foundgine.Sql compiles the ExecutionIR into a parameterized command.
Before anything runs, the final execution gate checks that the compiled plan's
fingerprint still matches the AuthorizationBinding from step 8 — if
authority changed in between, execution fails closed instead of running a stale
decision.
The provider executes the parameterized command. The agent never held database
credentials, never wrote SQL, and never saw a raw connection string — the only thing
that crossed the boundary was the authorized, security-proofed command from step 10.
The rows are shaped back into the answer (days-late computed from
expectedDate), and returned together with execution evidence: what was
authorized, which fields were denied, which provider ran it, and how many rows came
back. The agent can now answer in plain language — but everything it says is
traceable back to one authorization decision.
The key idea: the agent supplied one sentence. Foundgine supplied the
meaning, the ambiguity resolution, the authorization decision and the execution — and none
of those four things ever lived in the model's output. Change the caller to an API client
or a GraphQL client and steps 1–2 change shape; steps 3–12 do not.
This is one instance of the same canonical pipeline described on the
Architecture page — see the full canonical
architecture diagram there for the general-case shape, including parallel retrieval
strategies.
Next
Read AI agents for the general boundary this
example lives inside, or Security for how
authorization and provider conformance are enforced. See this exact "top supplier" case
wired into a reproducible, seeded benchmark — including the case where candidates tie
and Foundgine asks the agent to choose instead of guessing — on the
Supply Chain E2E page.