Threat Model¶
Status: Initial threat-model baseline
Scope: AI orchestration, authentication, authorization, integrations, data handling, and deployment security
Verification: Required controls must be verified against source code, automated tests, and deployed configuration before they can be considered implemented.
1. Purpose¶
This document identifies security threats affecting WhiteLotusAI and defines the mitigations, verification activities, and evidence required to manage them.
WhiteLotusAI combines AI orchestration with external integrations that may expose confidential email, calendar events, collaboration messages, documents, and issue-tracking data. This creates trust boundaries between users, application services, language models, integration clients, external providers, and persistent storage.
The initial integration phase is strictly read-only. WhiteLotusAI must not create, send, modify, delete, share, or otherwise mutate data in connected services.
This threat model establishes the security requirements for that operating model. It does not certify that the controls described here have been implemented or independently validated.
Security status is not implementation evidence
A documented requirement, configuration example, model instruction, or passing documentation build does not prove that a security control is enforced at runtime. Implementation status must be supported by source inspection, relevant tests, and deployment evidence.
Objectives¶
- Protect user identities, credentials, provider data, and application state.
- Prevent unauthorized access and cross-user data disclosure.
- Resist prompt injection and manipulation of model-generated instructions.
- Enforce read-only restrictions across every reachable execution path.
- Prevent credential leakage and unsafe fallback behavior.
- Establish traceable security findings, remediation ownership, and verification evidence.
2. Scope and security assumptions¶
| Area | Security requirement |
|---|---|
| Authentication | Identify the caller through a trusted authentication mechanism. |
| Authorization | Evaluate permissions using authenticated identity and server-side policy. |
| AI orchestration | Treat model output as untrusted input, not as an authorization decision. |
| Integrations | Permit only explicitly approved read operations. |
| Provider credentials | Use appropriately scoped, user-bound credentials and protect token material. |
| Data storage | Enforce ownership boundaries and protect sensitive records. |
| Observability | Record security-relevant events without unnecessarily exposing sensitive content. |
| Delivery pipeline | Protect secrets, dependencies, build artifacts, and deployment configuration. |
In-scope integrations¶
- Google Gmail
- Google Calendar
- Microsoft Teams
- Jira
- Google Drive
- Slack
The exact provider operations, OAuth scopes, endpoints, and execution paths must be verified against the current source code and provider configuration.
Out of scope: This document does not authorize write-capable integration features, establish a formal compliance certification, or assert that production controls have passed security testing.
3. Assets requiring protection¶
| Asset category | Examples | Primary security concern |
|---|---|---|
| Identity and sessions | User identities, JWTs, session state, roles | Impersonation and unauthorized access |
| Credentials | OAuth access and refresh tokens, client secrets, model-provider keys | Credential theft and misuse |
| User data | Prompts, conversation history, model outputs | Confidentiality and integrity |
| Provider data | Emails, events, messages, files, issues | Unauthorized disclosure and cross-user access |
| Application state | Database records, connection metadata, configuration | Unauthorized modification or exposure |
| AI execution controls | Tool registry, dispatch policies, operation parameters | Privilege escalation and prohibited execution |
| Infrastructure | CI/CD pipelines, images, deployment secrets, backups | Supply-chain compromise and service disruption |
| Security evidence | Audit records, incident reports, verification results | Loss of accountability or exposure of sensitive evidence |
4. Trust boundaries and architecture¶
The following conceptual diagram identifies the principal trust boundaries relevant to WhiteLotusAI's security review. It is a threat-model view, not a claim that every connection or enforcement point has been verified in the deployed system.
flowchart TB
User["Authenticated User"]
Frontend["Web Frontend"]
Gateway["API Gateway<br/>Authentication and request validation"]
Orchestrator["AI Orchestrator<br/>Intent and context processing"]
Model["Language Model<br/>Untrusted output"]
Policy["Server-Side Policy Enforcement<br/>Identity, authorization, read-only allowlist"]
Registry["Approved Read-Only Tool Registry"]
Integration["Integration Services<br/>User-bound credentials"]
Providers["External Providers<br/>Gmail, Calendar, Teams,<br/>Jira, Drive, Slack"]
Storage[("Application Database<br/>Sessions, connections, records")]
Logs[("Security Logs<br/>Redacted audit evidence")]
User --> Frontend
Frontend --> Gateway
Gateway --> Logs
Policy --> Logs
Integration --> Logs
Gateway --> Orchestrator
Orchestrator --> Policy
Orchestrator <--> Model
Policy --> Registry
Registry --> Integration
Integration --> Providers
Gateway --> Storage
Integration --> Storage
classDef identity fill:#DCEBFA,stroke:#2864A5,color:#17365D,stroke-width:1.5px
classDef application fill:#E8E2FA,stroke:#7251A3,color:#39265F,stroke-width:1.5px
classDef security fill:#D9F2E6,stroke:#16805D,color:#104D3A,stroke-width:2px
classDef external fill:#FCE8D5,stroke:#B86B24,color:#663A13,stroke-width:1.5px
classDef storage fill:#E8EDF2,stroke:#65758B,color:#263445,stroke-width:1.5px
classDef untrusted fill:#FBE0E0,stroke:#B42318,color:#7A1711,stroke-width:2px
class User,Frontend identity
class Gateway,Orchestrator,Integration application
class Policy,Registry security
class Providers external
class Storage,Logs storage
class Model untrusted
linkStyle default stroke:#8795A5,stroke-width:1.5px
Boundary analysis¶
| Trust boundary | Principal threat | Required protection |
|---|---|---|
| Client → API gateway | Forged identity or manipulated requests | Authentication, validation, and request authorization |
| Gateway → orchestrator | Unauthorized execution requests | Trusted identity propagation and policy checks |
| Model → application | Fabricated permissions or malicious instructions | Strict output validation and deterministic authorization |
| Provider content → model | Prompt injection in retrieved content | Treat retrieved content as untrusted data |
| Dispatcher → integration client | Unauthorized or prohibited operations | Server-side allowlisting and authorization |
| Integration → provider API | Excessive permissions or cross-user access | Least-privilege scopes and user-bound credentials |
| Application → database | Unauthorized access or tenant isolation failure | Ownership checks and secure query handling |
| Application → logs | Credential or sensitive-content exposure | Redaction, restricted access, and retention limits |
| CI/CD → deployment | Secret leakage or unreviewed changes | Protected credentials, controlled releases, and security checks |
For each boundary, the implementation review should identify the actual source modules, routes, handlers, credential flows, and enforcement points.
5. Threat register¶
The following register defines the baseline threats and the minimum expected mitigations. Severity must be assessed using the project's approved risk methodology rather than inferred solely from the order of the entries.
| ID | Threat | Example attack scenario | Required mitigation |
|---|---|---|---|
| TM-01 | Prompt injection | A retrieved email instructs the agent to disclose another user's information. | Treat retrieved content as untrusted and enforce authorization outside the model. |
| TM-02 | Planner privilege escalation | Model output supplies a fabricated confirmation or authorization flag. | Never trust model-controlled confirmation or permission fields. |
| TM-03 | Write-operation leakage | A mutation tool remains accessible despite a read-only UI. | Enforce a deny-by-default server-side allowlist and negative tests. |
| TM-04 | Direct endpoint bypass | A caller invokes a write-capable HTTP endpoint directly. | Enforce policy at the service boundary, independently of the frontend. |
| TM-05 | Alternate-path bypass | A legacy handler, worker, or RPC path performs a prohibited mutation. | Inventory reachable execution paths and test each applicable path. |
| TM-06 | Cross-user data access | One user retrieves another user's provider resources. | Bind identity, connection ownership, and authorization to the authenticated principal. |
| TM-07 | Credential exposure | Tokens appear in logs, errors, source control, or build artifacts. | Apply secret management, redaction, scanning, and credential rotation. |
| TM-08 | OAuth overpermission | An integration requests unnecessary write scopes. | Inventory scopes and apply least privilege and consent review. |
| TM-09 | Unsafe token fallback | Failed token resolution falls back to a shared or less restricted credential. | Fail closed and use consistent, user-bound token resolution. |
| TM-10 | SSRF or unsafe callback handling | User-controlled URLs influence outbound requests or OAuth redirects. | Restrict destinations, validate redirect targets, and prevent unsafe URL resolution. |
| TM-11 | Denial of service | Unbounded queries, pagination, or retries exhaust resources. | Apply input bounds, timeouts, concurrency limits, and retry budgets. |
| TM-12 | Sensitive-data leakage | Full provider messages are logged without an operational need. | Minimize collected data, redact sensitive fields, and enforce retention limits. |
| TM-13 | Dependency compromise | A vulnerable package introduces credential exposure or code execution. | Scan dependencies, review upgrades, and control build inputs. |
| TM-14 | Misleading security status | Documentation claims a control is implemented without evidence. | Track evidence, test results, owners, and explicit verification status. |
Threat prioritization¶
Prioritize findings using the team's approved likelihood and impact scale. Until a formal risk assessment is completed, do not assign numerical scores or label individual threats as resolved based solely on this baseline.
Give particular attention to:
- Read-only enforcement: Any reachable path that can mutate provider data.
- Authorization boundaries: Cross-user access, identity confusion, or privilege escalation.
- Credential security: Token exposure, excessive OAuth scopes, or unsafe fallback behavior.
- AI trust boundaries: Prompt injection or model-generated data influencing privileged decisions.
Release-blocking security conditions
Any confirmed path that permits a prohibited mutation, bypasses authorization, or exposes another user's protected data must be treated as a release-blocking security finding until the issue is remediated and the fix is verified.
6. Mandatory policy: read-only enforcement¶
Read-only access is an application security requirement, not a user-interface preference.
The application must define the permitted operations explicitly and reject every operation that is not approved. This policy must remain effective even if a user manipulates a request, the model produces malicious output, or a legacy execution path is invoked directly.
Required enforcement controls¶
- Maintain an explicit allowlist of approved read operations.
- Deny operations by default when they are unknown, unsupported, or not explicitly approved.
- Reject prohibited mutations before they reach provider clients.
- Apply the policy across AI tool dispatch, HTTP endpoints, RPC handlers, workers, and reachable legacy paths.
- Enforce authorization independently of frontend visibility and confirmation prompts.
- Prevent model-supplied fields from overriding server-side authorization.
- Fail closed when identity, permissions, connection ownership, or token resolution cannot be established.
- Never silently substitute shared credentials or a less restrictive credential path.
- Test both the denial response and the absence of provider-side execution.
- Review provider scopes as an additional safeguard, not as a substitute for application enforcement.
Illustrative enforcement sequence¶
The following pseudocode describes the required decision flow. It is a specification example, not production implementation code.
async def authorize_tool_execution(
principal,
connection,
operation,
parameters,
):
# 1. Reject unauthenticated or untrusted identities.
if principal is None:
raise AuthorizationError("Authentication required")
# 2. Reject operations outside the approved read-only registry.
if operation not in APPROVED_READ_OPERATIONS:
raise AuthorizationError("Operation not permitted")
# 3. Verify ownership and operation-level permissions.
if not await owns_connection(principal, connection):
raise AuthorizationError("Connection access denied")
if not await is_authorized(principal, operation, parameters):
raise AuthorizationError("Operation not authorized")
# 4. Validate parameters before any provider request.
validated = validate_operation_parameters(operation, parameters)
# 5. Resolve credentials for this principal and connection.
credentials = await resolve_user_bound_credentials(
principal,
connection,
)
if credentials is None:
raise AuthorizationError("Authorized credentials unavailable")
# Dispatch only after all applicable checks have passed.
return await execute_approved_read(
operation,
validated,
credentials,
)
Implementation requirements
The example uses illustrative function and exception names. Adapt it to the actual WhiteLotusAI service boundaries and error-handling conventions. Authorization must be enforced in the real execution path, not only in a wrapper that other handlers can bypass.
Read-only acceptance criteria¶
| Check | Passing condition | Required evidence |
|---|---|---|
| Approved reads | Authorized read operations execute successfully. | Positive integration tests |
| Prohibited writes | Mutation attempts are rejected before provider execution. | Negative tests and provider-call assertions |
| Direct endpoints | Direct requests cannot bypass the policy. | Route-level authorization tests |
| Alternate handlers | Workers, RPC paths, and legacy handlers cannot bypass the policy. | Execution-path inventory and tests |
| Forged model fields | Fabricated confirmation or permission values do not grant access. | Adversarial planner-output tests |
| Cross-user access | Another user's connection and data remain inaccessible. | Multi-user isolation tests |
| Credential resolution | Missing or invalid credentials fail closed. | Token-resolution and fallback tests |
| Provider scopes | Requested OAuth permissions match approved functionality. | Scope inventory and consent review |
See Read-Only Integration Security Policy for the detailed requirements and acceptance criteria.
7. Confirmation and authorization boundaries¶
A previously identified project risk involved trusting entities["__confirmed"] from planner or language-model output.
If that value is derived from untrusted model output, it cannot establish user consent or grant permission to execute an operation.
For any future operation that legitimately requires confirmation, approval must be represented by trusted application state associated with:
- The authenticated user.
- The exact proposed operation.
- The validated operation parameters.
- A limited validity period.
- A single-use or otherwise replay-resistant approval mechanism, where appropriate.
The dispatcher must independently verify authorization and applicable policy before execution.
A confirmation flag must never override the read-only restriction. Prohibited mutation operations must be rejected regardless of the presence, value, or apparent validity of any confirmation field.
8. Additional security requirements¶
8.1 Authentication and session integrity¶
- Validate authentication tokens using the configured verification policy.
- Enforce expiration and appropriate token-validation requirements.
- Prevent untrusted request fields from replacing the authenticated principal.
- Check authorization at the relevant resource and operation boundaries.
- Avoid exposing tokens or sensitive authentication details in responses and logs.
8.2 OAuth and credential lifecycle¶
- Request only the scopes necessary for approved read operations.
- Validate OAuth redirect URIs against registered, trusted destinations.
- Protect access tokens, refresh tokens, client secrets, and provider credentials.
- Associate credentials with the correct user and integration connection.
- Handle refresh failures without falling back to unrelated credentials.
- Review revocation, disconnection, expiration, and credential rotation behavior.
8.3 Prompt injection and untrusted content¶
Email bodies, documents, calendar descriptions, messages, issue descriptions, and tool outputs must be treated as untrusted content.
- Do not interpret retrieved instructions as changes to system policy.
- Do not allow retrieved content to grant permissions or change the authenticated identity.
- Validate tool names, arguments, and operation types independently of model output.
- Enforce data-access restrictions outside the model.
- Test malicious instructions embedded in otherwise legitimate provider content.
8.4 Data protection and logging¶
- Minimize the amount of provider data processed and retained.
- Redact credentials and sensitive content from logs, traces, and errors.
- Restrict access to security logs and operational records.
- Define retention and deletion requirements for application data and backups.
- Record security-relevant decisions without unnecessarily recording complete message or document contents.
8.5 Availability and dependency security¶
- Bound request sizes, query complexity, pagination, concurrency, and retries.
- Configure timeouts for external provider requests.
- Prevent retry loops and uncontrolled parallel execution.
- Scan dependencies and container images using the project's approved tooling.
- Protect CI/CD secrets and restrict access to release artifacts.
- Review production configuration for debugging features, permissive CORS settings, exposed services, and unnecessary privileges.
These requirements describe the expected security posture. Their implementation status must be assessed separately.
9. Risk assessment and findings management¶
Each identified finding must have a traceable record containing the information needed to reproduce, remediate, and verify the issue.
| Field | Required information |
|---|---|
| Finding ID | Unique identifier linked to the threat register where applicable |
| Component | Affected service, module, endpoint, or integration |
| Execution path | Route, handler, worker, dispatcher, or credential flow involved |
| Likelihood and impact | Assessment using the approved risk scale |
| Severity | Priority derived from the risk methodology |
| Evidence | Reproduction steps, source references, logs, or test results |
| Mitigation | Required corrective action and security rationale |
| Ownership | Responsible engineer or designated security reviewer |
| Target date | Agreed remediation deadline |
| Remediation reference | Linked issue, merge request, or change record |
| Verification | Test results and independent review evidence, where applicable |
| Residual risk | Remaining exposure and documented acceptance, if authorized |
Do not mark a finding as mitigated merely because a prompt, comment, configuration example, or documentation statement instructs the application to avoid the behavior.
Recommended finding lifecycle¶
flowchart TD
Identified["Threat Identified"]
Assessed["Risk Assessed"]
Assigned["Owner Assigned"]
Remediated["Fix Implemented"]
Tested["Security Tests Passed"]
Reviewed["Evidence Reviewed"]
Closed["Finding Closed"]
Identified --> Assessed
Assessed --> Assigned
Assigned --> Remediated
Remediated --> Tested
Tested --> Reviewed
Reviewed --> Closed
Tested -. "Failure" .-> Remediated
Reviewed -. "Insufficient evidence" .-> Remediated
classDef pending fill:#FCE8D5,stroke:#B86B24,color:#663A13,stroke-width:1.5px
classDef validation fill:#DCEBFA,stroke:#2864A5,color:#17365D,stroke-width:1.5px
classDef complete fill:#D9F2E6,stroke:#16805D,color:#104D3A,stroke-width:1.5px
class Identified,Assessed,Assigned,Remediated pending
class Tested,Reviewed validation
class Closed complete
linkStyle default stroke:#8795A5,stroke-width:1.5px
10. Security verification plan¶
The security review must combine source inspection, automated tests, and deployment verification.
| Verification area | Required activity | Expected evidence |
|---|---|---|
| Prompt injection | Test malicious instructions embedded in provider content. | Adversarial test results |
| Planner trust | Submit fabricated confirmation and authorization fields. | Tests showing no privilege escalation |
| Read-only enforcement | Attempt every known prohibited mutation path. | Denial assertions and no-provider-call evidence |
| Endpoint security | Test direct endpoint access and authorization bypass attempts. | Route and service-boundary tests |
| Cross-user isolation | Attempt access to another user's connections and resources. | Isolation test results |
| OAuth | Review scopes, redirects, token refresh, and revocation. | Configuration review and relevant tests |
| Credential handling | Scan secrets and inspect error/log redaction. | Scan reports and log-review evidence |
| Availability | Test input bounds, timeouts, concurrency, and retry limits. | Load or boundary-test results |
| Dependencies | Review dependency and container-image scan results. | Scan reports and remediation records |
| Deployment | Inspect production security configuration and exposed interfaces. | Deployment review checklist |
| Auditability | Verify that security decisions are logged appropriately. | Event samples and access-control review |
Evidence standards¶
A security control should be considered verified only when the available evidence supports the specific claim being made.
- Source inspection: Identify the actual enforcement point and determine whether bypass paths exist.
- Automated testing: Demonstrate both expected behavior and rejection of prohibited behavior.
- Integration testing: Confirm that security decisions remain effective across service and provider boundaries.
- Deployment review: Confirm that the running configuration preserves the intended controls.
- Evidence recording: Link the finding to test results, review records, and remediation changes.
Documentation builds are not security tests
A successful Zensical build validates documentation generation, not runtime authorization, provider-side behavior, credential isolation, or deployment security.
11. Review and maintenance¶
Review this threat model whenever:
- A provider integration or capability is added.
- A tool, endpoint, worker, handler, or execution path changes.
- OAuth scopes or credential-handling logic change.
- Authentication, authorization, or orchestration architecture changes.
- A new dependency introduces material security risk.
- A security incident or relevant vulnerability is identified.
- Verification results change the assessed risk or the implementation status of a control.
The project owner or designated security reviewer must review outstanding high-risk findings before release. Any accepted residual risk must be documented, assigned to an authorized decision-maker, and revisited when the relevant conditions change.
12. Related documentation¶
- Security Overview — security objectives, trust boundaries, and verification expectations.
- Read-Only Integration Security Policy — mandatory restrictions and acceptance criteria for connected services.
Document status: Initial threat-model baseline. Update this document as the architecture, security controls, and verification evidence evolve.