CREATE EXTERNAL MODEL is a database command used to register an external machine learning or AI model for use by the engine. It defines how the database reaches that model, what inputs are sent, and which permissions govern the call, so it is part of the database’s external execution surface.
What the command does in the database engine
CREATE EXTERNAL MODEL is not a general AI feature bolted onto a database, it is a control-plane command that registers an outside model as a callable dependency. The database stores how to reach the model, what data it may receive, and which permissions govern invocation, so the model becomes part of the engine’s external execution surface rather than a separate standalone service.
That matters because the database is now brokering a trusted call to something it does not directly host. The command therefore sits closer to integration, authorization, and outbound trust boundaries than to model training or ordinary query syntax.
How the database uses an external model safely
Once registered, the engine can treat the model as an external capability with defined access parameters. The security question is not just whether the model exists, but whether the database can invoke it without exposing the wrong rows, columns, prompts, or credentials to an outside system. In practice, this means the command has to define the call path clearly enough that administrators can reason about where data goes and who can trigger that flow.
The strongest design principle is least privilege for the invocation path. The database should only be able to reach the specific model endpoint or provider that was approved, and only the users, roles, or applications that need that capability should be able to register or invoke it.
Operational and governance implications
CREATE EXTERNAL MODEL creates a dependency that must be owned like any other externally reachable integration. If the registered model endpoint changes, is retired, or is replaced by a different provider, the database-side registration can fail or silently point at the wrong service unless configuration and change control are tight.
It also creates governance questions around data handling. If prompts, records, or feature inputs are sent out of the database, teams need to know what content is permitted, how it is minimized, and whether the external model is allowed to retain or reuse that information. The database command is therefore part of both technical integration and data governance.
Failure modes and trust boundaries
The main risk is that a trusted database feature becomes a route for unintended data exposure or overbroad execution. If the external model registration is too permissive, an attacker or careless administrator can route sensitive data to an untrusted endpoint, invoke a model with excessive authority, or abuse the model path as an outbound channel.
Because the command bridges an internal database and an external service, failures can also come from network trust, endpoint spoofing, credential misuse, and weak authorization around who may create or alter the registration. The trust boundary is the point of exposure: once the model is registered, the database will act on that relationship unless controls are deliberately restrictive.
Risk and Threat Considerations
CREATE EXTERNAL MODEL can expand the attack surface of a database because it gives database-adjacent code a way to reach an outside execution target. If the registration is misconfigured or abused, sensitive query content, embeddings, or application context may be sent to the wrong model endpoint, or a compromised model integration may become a foothold for further misuse.
Failure mechanism: Weak registration controls, endpoint manipulation, or excessive invocation rights allow an attacker or insider to redirect data, abuse trusted outbound calls, or trigger model use beyond its intended scope.
Impact: The result can be data leakage, unauthorized inference or transformation of sensitive inputs, broken trust in database outputs, and broader exposure if the model connection is used as a pivot into downstream systems.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP API Security Top 10 addresses the attack and risk surface, while NIST SP 800-53 Rev 5 and CIS Controls v8 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| NIST SP 800-53 Rev 5 | AC-4 — Information Flow Enforcement | CREATE EXTERNAL MODEL controls outbound data flow from the database to an external service. |
| IA-5 — Authenticator Management | External model calls depend on credentials or tokens that must be managed and rotated safely. | |
| CM-6 — Configuration Settings | The command registers trust and connectivity settings that must be baselined and controlled. | |
| Recommendation — Enforce approved data flows so database prompts and outputs only reach authorized model endpoints. Manage and rotate the credentials used for database-to-model authentication. Baseline and review model-registration settings so approved endpoints and permissions do not drift. | ||
| CIS Controls v8 | CIS-6 — Access Control Management | The feature should be limited to authorized users and administrators through controlled access. |
| Recommendation — Restrict who can create or modify external model registrations and invoke them. | ||
| OWASP API Security Top 10 | API8 — Security Misconfiguration | The registration creates an API-style trust boundary where misconfiguration can expose data or access paths. |
| Recommendation — Harden model endpoint settings and validate that external model calls cannot be redirected or overexposed. | ||
Practitioner Guidance
Why practitioners should care: Treat this command as a privileged integration point, not a convenience feature. The registration should be reviewed the same way you would review any external dependency that can see production data or influence application behavior.
Governance implication: Define clear ownership for the model endpoint, the allowed data classes, and the permissions required to create, modify, or invoke the registration. That ownership needs to be explicit enough that security, data, and platform teams can validate the relationship without guessing.
Practitioner takeaway: If the database can reach an external model, then the model path belongs in your access review, change management, and outbound trust model, not just in application configuration.
Related resources from NHI Mgmt Group
- Why do AI coding tools create governance and cost risk when they connect directly to external model providers?
- Why do browser-based AI assistants create different privacy risks when they are connected to external model APIs?
- Why do external model dependencies create risk for security governance?
- Why does Model Context Protocol create identity risk for enterprises?
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on November 4, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org