Subscribe to the Non-Human & AI Identity Journal
Architecture & Implementation Patterns

Query Plan Adapter

← Back to Glossary
By NHI Mgmt Group Updated June 10, 2026 Domain: Architecture & Implementation Patterns

Software that converts a policy expression tree into the native query syntax of a specific database or search engine. It bridges authorization policy and data retrieval so the enforcement point stays close to the data path. The security value depends on accurate schema mapping and operator translation.

Expanded Definition

A query plan adapter is the enforcement layer that turns an authorization policy tree into database-specific or search-engine-specific query syntax. In NHI security, it matters because the decision is no longer abstract: the adapter determines whether a service account, AI agent, or application can retrieve only the records it is permitted to see. This is distinct from policy evaluation itself, which answers yes or no; the adapter is responsible for preserving that decision when the request becomes SQL, a search filter, or another native query form.

Definitions vary across vendors because some products treat the adapter as part of policy enforcement, while others embed it inside the data access layer. The security requirement is the same: schema mappings, operator translation, and field-level restrictions must remain faithful to the original policy. A weak adapter can silently widen access even when the policy engine is correct, which is why this function is usually discussed alongside Zero Trust data access patterns in the NIST Cybersecurity Framework 2.0 and query-side enforcement designs. The most common misapplication is assuming policy correctness alone is sufficient, which occurs when teams validate the policy engine but never test the generated query output against real schemas.

Examples and Use Cases

Implementing query plan adapters rigorously often introduces schema-maintenance overhead, requiring organisations to weigh fine-grained access control against the cost of keeping mappings current as databases and indexes change.

  • A service account querying customer records has its policy translated into row filters so only assigned tenants are returned, even when the application issues a broad SELECT statement.
  • An internal search tool uses an adapter to convert an AI agent’s allowed scope into search-engine clauses, limiting which documents can be retrieved during tool use.
  • A healthcare workflow maps clinical-role policy into field-level filters, ensuring that sensitive attributes are excluded before the result set leaves the data store.
  • During post-incident review, engineers compare the generated query with the original policy to confirm that operator translation did not expand access beyond intent, a pattern often discussed in cases like the Microsoft Midnight Blizzard breach.
  • Data platforms that federate across multiple stores use an adapter to keep enforcement consistent while each backend retains its own native query dialect.

For implementation patterns, teams often compare this control point with database-level least privilege guidance in NIST Cybersecurity Framework 2.0 and with NHIMG research on how credentialed access is abused when enforcement is too coarse.

Why It Matters in NHI Security

Query plan adapters are where authorization becomes real for non-human identities. If the adapter misreads schema names, drops a filter, or mishandles an operator, an API key or service account can expose data far beyond its intended scope. This is especially dangerous in agentic systems, where autonomous tools may chain multiple queries and amplify a single translation error into broad data exposure. NHIMG research shows that 80% of identity breaches involved compromised non-human identities such as service accounts and API keys, which makes data-path enforcement a primary control objective rather than an optimisation detail.

It also matters because attackers often exploit the gap between policy intent and runtime execution. The adapter can become the last line of defense after a stolen token, over-permissive service account, or mis-scoped AI tool request reaches the data layer, as seen in incidents such as the Salt Typhoon US telecoms breach. Organisations typically encounter the impact only after an access review, leakage report, or breach investigation, at which point query plan adapter failures become operationally unavoidable to address.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Non-Human Identity Top 10 address the attack and risk surface, while NIST CSF 2.0 and NIST Zero Trust (SP 800-207) set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Non-Human Identity Top 10NHI-04Query translation errors can bypass intended data-scoping controls for non-human identities.
NIST CSF 2.0PR.ACLeast-privilege access must persist from policy decision through data retrieval.
NIST Zero Trust (SP 800-207)Zero Trust requires enforcement close to the resource, including query-time controls.

Ensure query adapters enforce least privilege at the data layer and are tested after schema changes.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on June 10, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org