System and method for secure external artificial intelligence service interaction with prompt intellectual property protection
The system addresses the integration challenges of AI services by externalizing prompt templates, ensuring secure and flexible deployment with centralized management and anonymization, enhancing intellectual property protection and compliance.
Patent Information
- Application Number
- US19/263542
- Authority / Receiving Office
- US · United States
- Patent Type
- Applications(United States)
- Current Assignee / Owner
- Filing Date
- 2025-07-09
- Publication Date
- 2026-11-26
AI Technical Summary
Current systems lack comprehensive solutions for integrating artificial intelligence services while protecting proprietary prompts from exposure, reverse-engineering, managing versions, ensuring security, and complying with regulatory requirements.
A computer-implemented system that externalizes proprietary prompt templates, implements robust intellectual property protection, and provides flexible deployment options, featuring a centralized repository, version control, anonymization, and multi-provider routing.
Ensures secure, flexible, and compliant integration of AI services by maintaining prompt templates within a trusted domain, preventing exposure, and simplifying version management and deployment across various architectures.
Smart Images

Figure US20260377499A1-D00000_ABST
Abstract
Description
FIELD OF THE INVENTION
[0001] The present invention relates to computer-implemented systems and methods for managing interactions between client applications and external artificial intelligence service providers. More specifically, the invention pertains to systems that externalize, secure, and manage proprietary prompt templates while facilitating dynamic content integration for artificial intelligence model interactions, with particular emphasis on intellectual property protection, version control, and deployment flexibility across multiple architectural models.BACKGROUND OF THE INVENTION
[0002] The proliferation of artificial intelligence services has created new challenges for organizations seeking to integrate AI capabilities into their applications while protecting proprietary intellectual property. Traditional approaches require embedding prompt logic directly into client application code, creating significant security vulnerabilities and intellectual property exposure risks.
[0003] Current limitations include:
[0004] Prompt Exposure: Proprietary prompts are visible in client-side code or transmitted as plaintext
[0005] IP Vulnerability: Valuable prompt engineering can be easily reverse-engineered or copied
[0006] Management Complexity: Versioning and updating prompts require application code changes
[0007] Security Gaps: No centralized control over AI service interactions or credential management
[0008] Compliance Issues: Difficulty tracking usage and maintaining audit trails for regulatory requirements
[0009] Existing solutions provide fragmented approaches, addressing individual components but lacking comprehensive integration of prompt protection, version control, and flexible deployment models.SUMMARY OF THE INVENTION
[0010] The present invention provides a comprehensive system and method for secure external artificial intelligence service interaction that addresses the aforementioned limitations through a novel architectural approach.
[0011] The invention comprises a computer-implemented system that externalizes proprietary prompt templates from client applications, implements robust intellectual property protection mechanisms, and provides flexible deployment options supporting both external Software-as-a-Service and internal enterprise architectures.
[0012] Key innovations include:
[0013] External Prompt Repository: Centralized storage of prompt templates separate from client application code
[0014] Version Control Integration: Git-like functionality specifically adapted for prompt management
[0015] Anonymization Layer: Disassociation of prompt ownership and source information while preserving functionality
[0016] Dynamic Content Integration: Real-time combination of static templates with variable inputs
[0017] Multi-Provider Routing: Intelligent selection and load balancing across multiple AI service providers
[0018] Deployment Flexibility: Support for both external SaaS and internal DMZ deployment models
[0019] Comprehensive Security: End-to-end protection with encryption, access control, and audit capabilitiesBRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings, which are incorporated herein and constitute part of this specification, illustrate exemplary embodiments of the invention and, together with the detailed description, serve to explain the principles of the invention.
[0021] FIG. 1 is a schematic block diagram illustrating a system architecture overview of the AI Prompt Gateway System (100), showing interconnected components including the Prompt Repository (110), Content Integration Engine (120), Version Control & Anonymization Module (130), Client Communication Interface (140), AI Service Interface (145), and Credential Management & Routing Module (150).
[0022] FIG. 2 is a schematic block diagram illustrating the data flow and security architecture of the system, showing the trusted domain boundary within which all sensitive prompt operations occur, including the flow of request data (401-403) through security layers and the return of AI responses.
[0023] FIG. 3 is a schematic block diagram illustrating the version control and anonymization system (130), including the Version Control Repository (500) with main branch (510) and feature branches (520), the Anonymization Layer (600), and the Integrated Prompt Version Management (550) component.
[0024] FIG. 4 is a schematic block diagram illustrating deployment models supported by the system, including the External SaaS Deployment Model (700) with multi-tenant capabilities and the Internal DMZ Deployment Model (800) for enterprise architectures.
[0025] FIG. 5 is a schematic block diagram illustrating the cryptographic protection architecture (900), including the Plaintext Prompt Template (910), Cryptographic Transform (920), Encrypted Template (930), Key Management System (940), Hardware Security Module (950), and Trusted Execution Environment (951).
[0026] FIG. 6 is a schematic block diagram illustrating the multi-provider routing architecture, including the AI Service Interface (145), Credential Management & Routing Module (150), Routing Decision Engine (151), Provider Health Monitor (152), Load Balancer (153), and Provider Connection Pool (155).
[0027] FIG. 7 is a schematic block diagram illustrating client integration patterns, comparing the Traditional Approach (Exposed) (270) with the Gateway Approach (Secure) (280), and showing the Request Processing Flow (290).
[0028] FIG. 8 is a schematic block diagram illustrating the security and compliance framework (1200), including the Access Control System (1210), Data Protection (1220) with Data Loss Prevention (1223), and Compliance Monitoring (1230).
[0029] FIG. 9 is a schematic block diagram illustrating the security integration and monitoring architecture, including the Security Integration Layer (1240) with Threat Detection (1251), Intrusion Prevention (1252), and Event Correlation (1253).DETAILED DESCRIPTION OF THE INVENTIONDefinitions
[0030] To provide a clear and consistent understanding of the invention, the following definitions are provided for terms used in the specification and claims.
[0031] The terms “prompt,”“input,”“query,” and their variations as used herein are intended to be interpreted broadly. A “prompt” is defined as any set of data, instructions, or context provided to an artificial intelligence system to elicit a response or cause the system to perform a task. This includes, without limitation: natural language text; structured data such as JSON or XML; machine-to-machine API calls; code snippets; and multimodal data. A prompt may comprise or incorporate one or more of: text strings, structured data fields, attachments, embedded objects, or multimodal content including images, audio, video, or sensor data. A prompt may further include contextual or metadata elements (e.g., user context, dynamic content) that are combined with a template to form the transmitted request. Such prompts represent executable content that embodies intellectual property, distinct from both conventional code (which is human-readable source) and data packets (which are mere transport containers). The disclosed inventions are designed to manage such prompts regardless of their origin (human, agent, or machine) or format.
[0032] The system distinguishes between three layers:
[0033] 1. Content Layer: The prompt template requiring execution-only access
[0034] 2. Metadata Layer: Versioning information that can be read / managed
[0035] 3. Transport Layer: Standard network protocols for transmission
[0036] “Version control” as used herein specifically refers to a system that maintains version history WITHOUT requiring read access to content. This is fundamentally distinct from conventional version control systems such as Git, which require content examination for diff operations, merge conflict resolution, and checkout operations. The present system performs version management exclusively through metadata operations, with template content remaining cryptographically and architecturally inaccessible for read operations outside the trusted domain.
[0037] A “Trusted Domain” means any computational environment, physical or virtual, where: (a) read access to protected data is technically prevented by hardware, software, or cryptographic means, and (b) access control is enforced at a level below the application layer. This includes, but is not limited to: hardware security modules, trusted execution environments, secure enclaves, kernel-protected memory, or hypervisor-isolated domains.
[0038] “Execution-only access” means the ability to use data in a computation WITHOUT the ability to: (a) read, copy, or export the data, (b) inspect the data through debugging interfaces, or (c) access the data through memory dumps or side channels, regardless of the specific technical mechanism used to enforce such restrictions. This explicitly excludes any system permitting content extraction, visualization, or examination, including through diff, blame, log, show, or any similar commands that would reveal template content.
[0039] As used herein, the term “dynamic content” refers to variable user inputs such as text strings, structured data, or sensor values that are combined with a stored template to form a complete prompt.
[0040] “Bias / inconsistency detection.” As used herein, the term bias detection refers to the identification of systematic differences in responses generated by one or more AI providers when prompt inputs are varied. In one embodiment, bias detection may also be described as inconsistency detection, which encompasses a broader category of response divergences, including, without limitation, statistical anomalies, demographic bias, inconsistent outputs across providers, or operational inconsistencies.
[0041] “Computer-implemented system.” As used herein, this phrase refers to a system comprising one or more processors and associated memory, executing instructions that implement the claimed functionality.
[0042] An “external” artificial intelligence service provider is any AI service that: (a) operates outside the direct memory space of the custody module, OR (b) is accessed through any inter-process communication mechanism, OR (c) requires network, API, or protocol-based communication, regardless of physical proximity or ownership structure.
[0043] “Prevents exposure” means preventing access by: (a) unauthorized users, (b) client applications, (c) external systems, (d) network interceptors, AND (e) any entity not explicitly granted access through the custody module's security policy, including system administrators without specific, task-based authorization.
[0044] “Anonymization” as used herein includes both irreversible anonymization and reversible pseudonymization, where the choice depends on configured policy.
[0045] “Placeholder data” means sanitized replacement content that maintains structural validity while removing sensitive information.Technical Incompatibility With Conventional Systems
[0046] The custody module's execution-only enforcement creates fundamental incompatibilities with existing version control and API gateway systems. Unlike Git or similar systems which require read access for basic operations (diff, merge, checkout), the present system maintains version history while making content permanently unreadable, even to administrators. Any attempt to integrate conventional version control would destroy the core security guarantee.
[0047] The system implements “blind versioning”—maintaining complete version history without any ability to view, compare, or examine the versioned content. This is achieved through cryptographic commitments and metadata tracking rather than content-based versioning.System Architecture Overview (FIG. 1)
[0048] The AI Prompt Gateway System (100) comprises several interconnected components designed to provide secure, scalable, and manageable interactions between client applications and external AI service providers.
[0049] The Prompt Repository (110) (also referred to as the “custody module” in the claims) serves as the central storage mechanism for static prompt templates, implementing enterprise-grade version control capabilities similar to distributed version control systems but specifically adapted for prompt management requirements. This component enforces execution-only access semantics that prevent read access to templates outside the trusted domain.
[0050] In one embodiment, the custody module (Prompt Repository 110) may be realized using a Hardware Security Module (HSM) or Trusted Execution Environment (TEE), thereby enforcing execution-only semantics consistent with the disclosure of FIG. 5.
[0051] The Content Integration Engine (120) (also referred to as the “isolation interface” in the claims) coordinates the entire template assembly process and handles the dynamic combination of static prompt templates with variable content received from client applications. This component manages version resolution and template retrieval through orchestrated interactions with the Version Control & Anonymization Module and Prompt Repository, ensuring secure validation and proper formatting before transmission to external AI services. The Content Integration Engine operates within the trusted domain and ensures that prompt templates remain inaccessible to processes outside this boundary while enabling template combination and execution.
[0052] The Version Control & Anonymization Module (130) provides sophisticated management of prompt evolution while implementing privacy-preserving techniques that disassociate authorship and organizational information from prompt content. This module responds to version resolution requests from the Content Integration Engine rather than acting independently.
[0053] The Client Communication Interface (140) manages all interactions with client applications, implementing authentication, authorization, rate limiting, and response processing while ensuring that proprietary prompt logic never reaches client systems.
[0054] The AI Service Interface (145) (also referred to as part of the “relay module” in the claims) handles communications with external artificial intelligence service providers, implementing provider-specific API adaptations, error handling, and performance monitoring. This component transmits complete prompts to external language-model service providers and returns inference results to client applications.
[0055] The Credential Management & Routing Module (150) (also part of the “relay module” functionality) provides centralized management of authentication credentials for multiple AI service providers while implementing intelligent routing decisions based on cost, performance, latency, and availability criteria.Data Flow and Security Architecture (FIG. 2)
[0056] The system implements a secure data flow that ensures proprietary prompt templates remain protected throughout the entire process lifecycle and establishes a trusted domain boundary within which all sensitive prompt operations occur.
[0057] When a client application (200) initiates a request, it transmits only a prompt identifier (401), dynamic content (402), and user context (403) to the Client Communication Interface (140). The client application contains no proprietary prompt logic, eliminating the risk of intellectual property exposure at the client level.
[0058] The system validates the request through multiple security layers including authentication validation, input sanitization, rate limiting, and comprehensive request logging. The Content
[0059] Integration Engine (120) coordinates the template assembly process by first requesting version resolution from the Version Control & Anonymization Module (130), which resolves the prompt identifier (404).
[0060] Using this version information, the Content Integration Engine then requests the specific template from the Prompt Repository (110) (405) and, if encrypted, performs secure decryption within the protected server environment. The Content Integration Engine (120) combines the template with dynamic content to create a complete prompt (406) ready for transmission to external AI services.
[0061] The Credential Management & Routing Module (150) selects the optimal AI service provider (407) based on predefined criteria and retrieves appropriate authentication credentials. The AI Service Interface (145) executes the API call and monitors the response (408) for errors, performance metrics, and content validation.
[0062] The processed response returns to the client application with comprehensive logging and monitoring throughout the entire flow, ensuring audit compliance while maintaining security boundaries. Throughout this entire process, the prompt template remains within the trusted domain and is never exposed outside this boundary during storage, combination, transmission, or return of the inference result.Version Control and Anonymization System (FIG. 3)
[0063] The Version Control & Anonymization Module (130) implements a comprehensive system for managing prompt template evolution while preserving privacy and intellectual property protection.
[0064] The Version Control Repository (500) implements sophisticated branching and merging capabilities specifically designed for prompt template management. The system maintains a main branch (510) for production-ready prompts while supporting feature branches (520) for development and testing of specialized prompt variations. Individual prompt versions are tracked with specific identifiers, including initial prompts (511), validation updates (512), security enhancements (513), and major revisions (514).
[0065] The system supports specialized feature branches for domain-specific development, including legal prompts (521) with specific versions for legal contact analysis (522) and legal compliance analysis (523), and prompt analysis branches (524) containing analytical prompt variations (525). Each prompt version includes comprehensive metadata tracking changes, dependencies, and performance metrics while implementing robust anonymization protocols.
[0066] The Version Control Operations (540) component manages standard version control operations including branch creation and merging, rollback capabilities, and change tracking with diff analysis. Version commands (641) flow from the operations component to the repository, while version data (642) is extracted for management purposes.
[0067] The Anonymization Layer (600) transforms original metadata (610) containing personally identifiable information into anonymized representations (620) that preserve functional relationships while eliminating privacy concerns. The system processes metadata transfer (604) from the version control repository and returns anonymized metadata (605) for secure storage. The Anonymization Rules (630) component implements configurable rules that can be adapted to different organizational and regulatory requirements.
[0068] Key anonymization features include PII removal, organizational masking, temporal obfuscation, client anonymization, preservation of functional relationships, and maintenance of audit trails without identity exposure.
[0069] The Integrated Prompt Version Management (550) component coordinates version-controlled prompts with complete change history, ensures anonymized metadata preserves privacy while maintaining audit trails, and provides branch / merge capabilities for collaborative development. This component sends version resolution data (643) to the Content Integration Engine (120) for prompt management (406).Deployment Models (FIG. 4)
[0070] The system supports two primary deployment architectures, each optimized for different organizational requirements and security postures.
[0071] External SaaS Deployment Model (700) provides multi-tenant capabilities with customer isolation (710, 720, 730) while sharing underlying infrastructure (740). This model offers global CDN distribution, automatic scaling, centralized monitoring, and managed compliance capabilities suitable for organizations preferring external managed services.
[0072] Internal DMZ Deployment Model (800) positions the system within enterprise network architecture as a secured intermediary in the DMZ zone (820). This deployment model integrates with existing enterprise security infrastructure while maintaining isolation between internal applications (810) and external internet zones (830).
[0073] Both deployment models utilize identical core functionality, ensuring consistency and migration capabilities between architectures based on changing organizational requirements. The deployment architecture is selectable without modification to client application code.Cryptographic Protection Architecture (FIG. 5)
[0074] The Cryptographic Protection System (900) implements comprehensive encryption and security measures to protect prompt templates throughout their lifecycle while maintaining execution capabilities within the trusted domain.
[0075] The Plaintext Prompt Template (910) represents the original template (P) before encryption. The Cryptographic Transform (920) implements the encryption function T(P, K, R) using the provided secret key and random value to generate ciphertext. The Encrypted Template (930) stores the resulting ciphertext (C) in a format that prevents unauthorized access while preserving the ability to decrypt within the trusted domain.
[0076] The Key Management System (940) coordinates cryptographic operations by managing the Secret Key (941) and Random Value (942). This system supplies keys and random values to the cryptographic transform while ensuring proper entropy validation. The Supported Algorithms (953) are not limited to the illustrated set. In various embodiments, they may include symmetric encryption schemes, authenticated encryption schemes, or asymmetric and post-quantum algorithms. Specific algorithms such as AES-GCM, ChaCha20-Poly1305, or CRYSTALS-Kyber are provided as examples only.
[0077] The Entropy Requirements (954) component validates that random values meet minimum 64- bit entropy requirements for salt, nonce, or initialization vector generation.
[0078] The Hardware Security Module (950) provides tamper-resistant storage and implements key unwrap protocols for secure key management. The Trusted Execution Environment (951) offers secure processing capabilities through Intel SGX, AMD SEV, AWS Nitro, or similar secure enclaves. The Execution-Only Access Control (952) enforces read access prevention outside the trusted domain while permitting concatenation and execution within protected boundaries.
[0079] The Persistent Storage (955) component manages secure storage and template retrieval operations, ensuring encrypted templates are safely stored and can be retrieved for decryption when needed. This component integrates with the Content Integration Engine (120) to provide seamless access to encrypted prompt templates during the prompt assembly process while maintaining cryptographic protection throughout the entire workflow.Advanced Prompt Security and Policy Enforcement
[0080] As shown in FIG. 9, the SECURITY INTEGRATION LAYER (1240) includes a THREAT DETECTION (1251) module. This module is configured to analyze incoming dynamic context data (402) for signatures indicative of malicious inputs, including but not limited to prompt injection and jailbreaking attempts. This analysis is a form of the input sanitization and application of security rules. The threat detection module (1251) may employ conventional prompt injection detection techniques known in the art as of the filing date.
[0081] As shown in FIG. 8, the DATA PROTECTION (1220) framework includes a DATA LOSS PREVENTION (1223) module. This module is configured to operate according to a defined prompt policy. Said policy may include rules for identifying non-permissible content, such as Personally Identifiable Information (PII), as part of the disclosed PII Detection and Content Classification capabilities. Upon detection, the system is configured to perform an action defined by the policy, including, without limitation, rejecting the prompt, flagging the content for review, or automatically redacting the non-permissible content and replacing it with placeholder data before it is combined with the prompt template by the Content Integration Engine (120).Prompt Integrity Protection Implementation
[0082] In one embodiment, the threat detection module (1251) implements a multi-stage prompt integrity protection process: (i) scanning prompts and associated resources including attached files, embedded URLs, and destination links for security indicators; (ii) applying remediation through replacement, quarantine, or flagging; and (iii) augmenting prompts with protective instructions that leverage AI systems' instruction-following behavior defensively, causing them to maintain prompt integrity and report injection attempts.Multi-Provider Routing Architecture (FIG. 6)
[0083] The Multi-Provider Routing Architecture demonstrates the system's capability to intelligently distribute requests across multiple AI service providers while maintaining optimal performance, cost efficiency, and compliance requirements.
[0084] The AI Service Interface (145) coordinates with the Credential Management & Routing (150) module to implement sophisticated routing decisions. The Routing Decision Engine (151) performs cost analysis and latency monitoring to determine optimal provider selection (407). The Provider Health Monitor (152) continuously tracks availability and error rates, providing health status feedback (663) to ensure only healthy providers receive traffic.
[0085] The Load Balancer (153) implements round robin and weighted distribution algorithms to manage traffic distribution (661) across the Provider Connection Pool (155). The connection pool maintains connections to External Provider 1 (310), External Provider 2 (320), External Provider 3 (330), and Internal Provider (340), each with distinct API configurations, status monitoring, and latency characteristics.
[0086] The Routing Criteria (156) component analyzes performance, cost, and compliance factors (664) to guide routing decisions. The Real-Time Metrics Dashboard (154) aggregates performance data (662) from all providers, displaying total requests per minute, average latency, error rates, and cost per token metrics for operational monitoring and optimization.
[0087] The system integrates with the Content Integration Engine (120) through prompt management (665) communications, ensuring seamless coordination between prompt assembly and provider routing. This architecture enables the system to automatically adapt to changing provider conditions, optimize costs through intelligent routing, and maintain high availability through redundancy and failover capabilities.Client Integration Patterns (FIG. 7)
[0088] The Client Integration Patterns demonstrate the fundamental security and operational advantages of the gateway approach compared to traditional client-side prompt handling methodologies.
[0089] The Client Application Domain (200) illustrates two contrasting approaches to AI service integration. The Traditional Approach (Exposed) (270) represents the security-vulnerable pattern where embedded prompt logic remains visible in source code, API keys are hardcoded, and version management requires application updates. The Security Risks Traditional Approach (275) identifies critical vulnerabilities including IP exposure risk, reverse engineering vulnerability, compliance violations, hardcoded credential exposure, version management complexity, and audit trail gaps.
[0090] In contrast, the Gateway Approach (Secure) (230) implements the secure pattern through Minimal Request Payload (281) transmission containing only prompt identifiers, dynamic content, and session context. This approach provides Client Benefits (282) including no embedded secrets, dynamic updates, and simplified code architecture.
[0091] The Request Processing Flow (290) demonstrates the complete secure workflow: Step 1 receives requests (401-403) via Client Communication Interface (140) with authentication validation and rate limit checking; Step 2 resolves prompts (404-405) via Version Control (130) to lookup template identifiers and retrieve latest versions; Step 3 combines content (406) via Content Integration Engine (120) merging templates with dynamic content while applying security rules; Step 4 executes AI calls (407-408) via AI Service Interface (145) selecting providers and sending to AI services; and Step 5 returns responses (409) via Client Communication Interface (140) providing AI results only.
[0092] The minimal payload (671) flows from client to gateway containing only non-sensitive data, while the AI response (672) returns only processed results without exposing proprietary prompt logic. The Key Benefit (285) ensures that proprietary prompt logic never leaves the gateway, with clients receiving only AI-generated responses, not prompt templates.
[0093] This architecture fundamentally transforms client-AI interactions from a security-vulnerable direct integration to a secure, managed service pattern that protects intellectual property while simplifying client application development.Security and Compliance Framework (FIG. 8)
[0094] The system implements comprehensive security controls addressing authentication (1211), authorization (1212), data protection (1220), and compliance monitoring (1230).
[0095] Access control mechanisms include API key validation, JWT token verification, OAuth 2.0 integration, multi-factor authentication, and certificate-based authentication. Role-based access control (1213) provides granular permissions management with predefined roles for developers, reviewers, deployers, administrators, and auditors.
[0096] Data protection encompasses encryption in transit (1221) using TLS 1.3 with perfect forward secrecy, and encryption at rest (1222) using AES-256 with regular key rotation. Data loss prevention (1223) capabilities include PII detection, content classification, watermarking, egress monitoring, and third-party sharing controls.
[0097] Compliance monitoring (1230) provides comprehensive audit logging and automated compliance checks for GDPR, SOX, HIPAA, SOC 2, and ISO 27001 requirements.Further Technical Variations and Equivalents (FIG. 9)
[0098] The custody module described herein may be realised by any mechanism that enforces execution-only access semantics. Non-limiting examples include hardware-based trusted execution environments such as Intel® SGX, AMD SEV or AWS Nitro Enclaves; tamper-resistant hardware security modules; secure elements; or operating-system enforced write-protected memory regions that disallow read access from processes outside a defined trust boundary.
[0099] The cryptographic transform T referenced in the claims may be any symmetric or asymmetric primitive that is reversible only with possession of a secret key K. Suitable primitives include, without limitation, AES-GCM, ChaCha20-Poly1305, XChaCha, Serpent, Twofish, or post-quantum schemes such as CRYSTALS-Kyber combined with authenticated encryption. The random value R may be instantiated as a salt, nonce, initialisation vector or other entropy source provided it possesses at least 64 bits of unpredictability.
[0100] Those skilled in the art will recognise that any secure micro-kernel, container runtime or memory-isolation technique that prevents read access to the prompt template while permitting execution or concatenation falls within the scope of the invention. Reference to specific hardware or software implementations is therefore illustrative and not limiting.
[0101] In one embodiment, the isolation interface performs the following illustrative steps: (i) receives a prompt identifier and dynamic context data; (ii) retrieves encrypted template C from the custody module; (iii) decrypts C within the trusted domain; (iv) concatenates the plaintext template P with the dynamic context; and (v) streams the complete prompt to a language-model service provider. Equivalent algorithms that achieve the same technical effect—namely, preventing template exfiltraticn while enabling execution—are expressly contemplated.
Claims
1. A computer-implemented system for executing artificial-intelligence prompts or inputs while preventing exposure of proprietary prompt or input content, comprising:a custody module configured to store a prompt or input template in an execution-only data store that prevents read access to the template outside a trusted domain;an isolation interface configured to receive dynamic context data from a client application, obtain a reference to the stored prompt template and, while the template remains inaccessible to processes outside the trusted domain, combine the template with the dynamic context data to generate a complete prompt or input;a relay module configured to transmit the complete prompt or input to at least one external language-model and artificial intelligence service provider and return an inference result to the client application; andwherein the prompt or input template, in whole or in part, is not exposed outside the trusted domain during storage, combination, transmission, or return of the inference result.
2. The system of claim 1, wherein the execution-only data store is selected from the group consisting of: a hardware security module, a trusted execution environment, a secure element, or an operating-system-enforced write-protected memory region.
3. The system of claim 1, wherein the prompt template is stored as ciphertext C=T(P, K, R), where P is the plaintext template, K is a secret key and R is a random value providing at least 64 bits of entropy, irrespective of whether R is generated as a salt, nonce, initialisation vector or other random construct.
4. The system of any preceding claim, further comprising a version-control engine configured to maintain a persistent version identifier for each prompt or input template, the engine supporting at least one of branching, merging or linear versioning of prompt or input templates.
5. The system of any preceding claim, further comprising an anonymisation layer configured to remove or obfuscate author identifiers, organisational identifiers, timestamps or other metadata from the prompt or input template prior to storage or version comparison while preserving functional semantics.
6. The system of any preceding claim, wherein the relay module comprises a routing engine configured to select from a plurality of language-model and artificial intelligence service providers on the basis of at least one of cost, latency or compliance requirements.
7. The system of claim 6, wherein the routing engine is further configured to hot-swap provider-specific credentials without invalidating existing prompt identifiers.
8. The system of any preceding claim, further comprising a diff engine configured to compute a difference between two versions of a prompt or input template, mask or remove sensitive metadata, and store the masked difference record in an audit log.
9. The system of any preceding claim, wherein cryptographic keys required to decrypt the prompt or input template are stored in a hardware security module and are released to the custody module under a single-use key-unwrap protocol.
10. The system of any preceding claim, wherein the system operates in an external Software-as-a-Service deployment or an internal enterprise deployment, the deployment architecture being selectable without modification to client application code.
11. A computer-implemented method for executing artificial-intelligence prompts or inputs, the method comprising:receiving, from a client application, a prompt or input identifier and dynamic context data;retrieving, by a custody module, a prompt template associated with the identifier from an execution-only data store that prevents read access outside a trusted domain;combining, by an isolation interface within the trusted domain and without exposing the template outside the trusted domain, the prompt template with the dynamic context data to generate a complete prompt or input;transmitting, by a relay module, the complete prompt to at least one external language-model or artificial intelligence service provider;receiving an inference result from the external language-model or artificial intelligence service provider; andreturning the inference result to the client application without exposing the prompt or input template outside the trusted domain.
12. The method of claim 11, further comprising selecting the external language-model or artificial intelligence service provider from a plurality of providers based on at least one of latency, cost, or compliance constraints.
13. The method of claim 11 or 12, further comprising storing the prompt or input template as ciphertext C=T(P, K, R) with a cryptographic transform T and random value R.
14. The method of any of claims 11-13, further comprising maintaining a version history of the prompt template supporting branching and merging, and computing anonymised differences between versions.
15. A non-transitory computer-readable medium storing instructions that, when executed by one or more processors, cause the processors to perform the method of any of claims 11-14.
16. The system of claim 1, further comprising a threat detection module configured to analyze the dynamic context data for signatures indicative of a prompt injection attack prior to the isolation interface combining the template with the dynamic context data.
17. The system of claim 1, further comprising a data loss prevention module configured to: analyze the dynamic context data based on an input policy to identify non-permissible content; and, prior to the isolation interface combining the template with the dynamic context data, replace the identified non-permissible content with placeholder data.
18. A method performed by a gateway system, comprising:receiving dynamic context data transmitted by a client application;analyzing, within the gateway system, the received dynamic context data for signatures indicative of a prompt injection or prompt forwarding attack;upon detecting no attack signatures, combining a prompt template with the dynamic context data within a trusted domain;wherein the analyzing step occurs entirely within the gateway system prior to any template combination.
19. The system of claim 1, wherein the custody module operates without maintaining any persistent log of the input template content accessible to any entity outside the trusted domain, including system administrators.
20. The system of claim 16, wherein the threat detection module is further configured to augment the analyzed dynamic context data with protective instructions that cause the artificial intelligence service provider to resist execution of subsequently encountered injection attempts and report detection of inconsistent or bias-related instructions, or otherwise conflicting instructions.
21. The system of claim 1, wherein the version-control engine maintains version history and supports branching operations without performing any read operations on prompt template content, including, but not limited to, diff visualization, merge content inspection, or checkout examination as required by conventional version control systems such as Git.
22. The system of claim 1, wherein the custody module operates configured without any mechanism for content extraction, export, or visualization, including the absence of any diff, blame, log, show, or comparable operations that would reveal prompt template content.
23. The system of claim 1, wherein the custody module and version-control engine are configured such that operations requiring read access to template content, including diff, merge, and checkout operations, cannot be executed, thereby rendering the system incompatible with conventional version control systems such as Git.
24. The system of claim 1, wherein the system maintains separation between prompt content requiring execution-only protection and transport metadata accessible for network routing, enabling integration with standard network infrastructure while preventing exposure of the prompt template content.
25. The system of claim 1, further comprising a detection module configured to perform bias / inconsistency detection as defined herein, wherein the module identifies systematic response divergences, including, without limitation, demographic bias, statistical anomalies, inconsistent outputs across providers, or operational inconsistencies.
