Prompt injection is treated as an expected input condition, not an edge case. User messages, retrieved content, connector descriptions, OpenAPI specs, and connector responses can all contain instructions that conflict with system policy.
The implementation security model is maintained in docs/security/customer-data-connectors.md. The prompt-injection security scenarios are maintained in docs/prompt-injection-security-tests.md.
Core Principle
The model is never an authorization authority. It can choose from tools the server offered, but it cannot decide who the user is, which organization owns data, or whether a cross-user result is safe to return.
Threat Model
Kommander.ai assumes every model-visible input can be hostile or misleading:
| Trust boundary | Threat | Required control |
|---|---|---|
| User chat text | The user asks the assistant to ignore policy, reveal hidden prompts, impersonate an admin, or call tools for another customer. | Keep authorization in server code, not prompts. |
| Retrieved documents and training content | A document contains instructions that try to override the assistant or exfiltrate data from another account. | Treat retrieval as untrusted context and only expose data already authorized for the requester. |
| Customer data connector metadata | OpenAPI summaries, parameter descriptions, operation IDs, or defaults contain prompt-control text, fake secrets, or identity-spoofing templates. | Sanitize model-facing descriptions and reject unsupported verified-user templates before tools are exposed. |
| Model-generated tool arguments | The model includes spoofed email, userHash, verifiedUser, signature, timestamp, or nested identity fields. | Strip reserved fields and inject verified identity from server context only. |
| Connector responses | A connector returns another user’s records, missing owner markers, oversized payloads, or content that asks the model to leak data. | Verify ownership markers, enforce response limits, redact/audit events, and return empty successful results for mismatches. |
| Outbound connector URLs | A connector definition attempts SSRF against localhost, private networks, metadata services, or DNS names resolving internally. | Validate URLs, block internal addresses, restrict redirects, and enforce timeouts. |
The primary assets are customer records, conversation history, connector credentials, signed widget identity, organization membership, audit logs, and billing metadata. The primary failure modes are cross-user disclosure, cross-organization disclosure, unauthorized tool execution, credential leakage, and model-generated misinformation presented as authorized data.
Defense Layers
| Layer | Control |
|---|---|
| Identity verification | Customer data tools are hidden unless the request has verified identity with a non-empty userHash. |
| Tool discovery | The server offers only tools available to the current organization and verified identity context. |
| Tool allow-list | Tool calls are checked against the tool names offered in the current request. Hallucinated tools are not executed. |
| Argument stripping | Reserved identity fields such as id, email, userHash, metadata, verifiedUser, and signature material are removed from model-generated arguments. |
| Server-side identity injection | OpenAPI identity parameters are hidden from the model and filled from context.verifiedUser at execution time. |
| Metadata sanitization | Prompt-control language, internal identifiers, fake secrets, and cross-user instructions in OpenAPI descriptions are replaced with neutral tool descriptions. |
| Ownership verification | Tool results that do not match the verified identity become empty successful results before the model sees them. |
| Audit hooks | Ownership mismatches and limit events are recorded for investigation. |
| SSRF and limits | Connector calls are subject to outbound URL validation, timeouts, redirect restrictions, and response-size limits. |
Tested Attack Scenarios
The security suite covers:
- Ignore-instructions and hidden-prompt extraction attempts.
- Role spoofing, including claims to be an administrator or platform owner.
- Tool override prompts that try to force a different customer ID.
- Encoded exfiltration prompts.
- Model-generated identity spoofing through nested argument objects.
- Hallucinated admin tools that were not offered in the request.
- Malicious OpenAPI specs that expose identity fields as caller-supplied parameters.
- Tool description leakage of internal IDs, fake secrets, or prompt-control text.
- SSRF targets including localhost, private networks, metadata services, and DNS names resolving internally.
Security failures must be graceful and non-leaking. The expected result is a generic tool error or an empty successful result, not partial disclosure.
Security Best Practices
For Kommander.ai Operators
- Run
yarn test:securitybefore releasing changes that affect customer data connectors, tool execution, OpenAPI conversion, ownership filtering, SSRF validation, widget identity, or streaming responses. - Run
yarn test:prompt-injectionfor prompt-injection-only changes and when adding new corpus cases. - Keep prompt-injection scenarios aligned with production incidents, new connector types, and newly observed bypass attempts.
- Review audit records for ownership mismatches, missing identity, tool allow-list failures, and connector limit events after deployment.
- Keep customer-facing error messages generic for authorization, identity, and connector rejection failures.
- Never log raw connector credentials, HMAC secrets, signed identity payloads, or unredacted sensitive fields.
For Connector Integrators
You should configure upstream systems as though prompt injection will happen:
- Do not rely on prompt instructions for authorization.
- Issue least-privilege connector credentials.
- Bind connector operations to the signed widget identity.
- Keep OpenAPI descriptions factual and free of instructions to the assistant.
- Avoid broad export, admin, or multi-customer operations.
- Include ownership markers in connector responses.
- Test with two users before production and confirm one user’s records never appear for the other.
Known Limitations
Prompt-injection defenses reduce the chance of unauthorized tool use and cross-user disclosure, but they do not make arbitrary connector output trustworthy. If a connector returns incorrect ownership markers, omits ownership markers, or exposes overly broad data through a least-privilege failure upstream, Kommander.ai may have less context for filtering.
Treat customer data connectors as a defense-in-depth boundary around your own authorization model, not a replacement for it.
Response Playbook
If prompt injection or customer-data tool misuse is suspected:
- Disable or restrict the affected connector, assistant, or customer-data tool path.
- Preserve correlation IDs, conversation IDs, organization IDs, connector IDs, request timestamps, and relevant audit log entries.
- Determine whether the issue is an identity verification failure, tool allow-list failure, ownership-filter failure, connector metadata issue, SSRF issue, or upstream authorization issue.
- Reproduce with owned test accounts and the security test corpus; do not use another customer’s data for reproduction.
- Add or update regression coverage in the prompt-injection or security suite before re-enabling the affected path.
- Notify affected deployment owners when customer data exposure is confirmed or cannot be ruled out.
Public reporting instructions are documented in Reporting a Vulnerability. Broader incident handling and update cadence are documented in Security Operations.