Security Overview¶
WhiteLotusAI combines AI orchestration with enterprise integrations that may access confidential emails, documents, calendar events, issues, and collaboration data. Security must therefore be enforced by trusted application components rather than delegated to the AI model or frontend.
Document status
Classification: Security baseline
Scope: Application security, AI orchestration, integrations, and operational controls
Verification status: Requirements and verification expectations; implementation must be assessed independently.
Controls described in this document are not automatically verified merely because they are documented.
1. Purpose¶
This document establishes the security objectives, trust boundaries, and verification expectations for WhiteLotusAI. It serves as the entry point for the detailed security policies and threat analysis maintained in this documentation.
The security baseline is intended to guide implementation, code review, testing, deployment, and release-readiness decisions.
Security principles¶
-
Defense in depth
Enforce security at multiple independent layers. Do not rely exclusively on frontend restrictions, model behavior, or developer instructions.
-
Least privilege
Grant users, services, and integrations only the permissions necessary for approved operations.
-
Data isolation
Bind conversations, credentials, provider connections, and retrieved data to the appropriate user and authorization context.
-
Evidence-based verification
Mark controls as verified only after appropriate source review, testing, and configuration checks provide supporting evidence.
2. Security objectives¶
WhiteLotusAI security engineering must prioritize the following objectives.
| Objective | Required outcome |
|---|---|
| Authentication | Establish the identity of users and trusted internal services. |
| Authorization | Verify that each requested operation is permitted for the authenticated principal. |
| Read-only enforcement | Block prohibited mutations against connected services during the initial integration phase. |
| Data isolation | Prevent unauthorized cross-user access to conversations, credentials, connections, and provider data. |
| Credential protection | Safeguard OAuth tokens, application secrets, and sensitive configuration. |
| Input and output validation | Validate untrusted requests, tool arguments, and external responses. |
| Resilience | Use timeouts, bounded operations, controlled retries, and safe failure behavior. |
| Auditability | Record security-relevant events without unnecessarily exposing sensitive information. |
| Maintainability | Require security review and regression testing when execution paths or integrations change. |
3. Security boundaries and architecture¶
Security reviews must identify where trust changes, which component is responsible for enforcement, and what evidence demonstrates that enforcement works.
The following diagram presents the logical security boundaries that must be reviewed. It is a security model, not a claim that every control has already been implemented.
flowchart TB
USER["User / Client"]
FRONTEND["Frontend"]
GATEWAY["API Gateway<br/>Authentication and request validation"]
ORCHESTRATOR["AI Orchestration<br/>Untrusted model proposals"]
POLICY["Trusted Policy Layer<br/>Authorization and operation allowlist"]
INTEGRATIONS["Integration Services<br/>User-bound credentials"]
PROVIDERS["External Provider APIs"]
DATA[("Database and Conversation State")]
LOGS["Audit Logs and Monitoring"]
GATEWAY -.-> LOGS
POLICY -.-> LOGS
INTEGRATIONS -.-> LOGS
USER --> FRONTEND
FRONTEND --> GATEWAY
GATEWAY --> ORCHESTRATOR
ORCHESTRATOR -->|"Proposed operation"| POLICY
POLICY -->|"Authorized operation only"| INTEGRATIONS
INTEGRATIONS --> PROVIDERS
GATEWAY --> DATA
ORCHESTRATOR --> DATA
INTEGRATIONS --> DATA
classDef client fill:#E8F1FF,stroke:#3767A6,color:#17365D,stroke-width:1.5px
classDef trusted fill:#DDF5E5,stroke:#24804A,color:#174D30,stroke-width:1.5px
classDef ai fill:#F2E8FF,stroke:#8250B4,color:#4B2675,stroke-width:1.5px
classDef external fill:#FFF0D9,stroke:#B87519,color:#70420C,stroke-width:1.5px
classDef storage fill:#E2F4F4,stroke:#277F83,color:#155457,stroke-width:1.5px
class USER,FRONTEND client
class GATEWAY,POLICY,INTEGRATIONS trusted
class ORCHESTRATOR ai
class PROVIDERS external
class DATA,LOGS storage
Figure 1. Logical security boundaries and enforcement responsibilities.
Boundary review checklist¶
| Boundary | Required security review |
|---|---|
| Client to API | Authentication, request validation, and rate limiting |
| Authentication and sessions | Token validation, expiry, revocation, and identity binding |
| AI orchestration | Prompt injection, untrusted content, and model-generated arguments |
| Tool registry and dispatch | Operation allowlisting, schema validation, and authorization |
| Integration services | Internal authentication, user-bound credentials, and alternate execution paths |
| Provider connections | OAuth scopes, connection ownership, and resource-level authorization |
| Data storage | Ownership checks, tenant isolation, retention, and access restrictions |
| Operations and deployment | Secret management, logging, dependency security, and deployment configuration |
Trust boundary rule
No component should be considered trusted solely because it runs internally. Internal endpoints, background workers, message queues, and alternate dispatch paths must enforce the appropriate authentication and authorization requirements.
4. Read-only integration security¶
The initial integration scope is read-only for the following providers:
- Google Gmail
- Google Calendar
- Microsoft Teams
- Jira
- Google Drive
- Slack
Only explicitly approved read operations may execute. Operations that send, create, update, delete, share, move, or otherwise modify external resources must be blocked during this phase.
Mandatory safeguards¶
- Maintain an explicit allowlist of approved operations.
- Enforce authorization on the server before any provider operation executes.
- Apply consistent restrictions across HTTP routes, tool dispatch, RPC handlers, workers, and reachable alternate paths.
- Bind credentials and provider connections to the authenticated user.
- Fail closed when identity, authorization, or connection ownership cannot be established.
- Test that denied operations never reach provider clients.
- Reassess the policy whenever an integration or execution path changes.
Read-only means enforced, not implied
A frontend restriction, prompt instruction, confirmation dialog, or provider OAuth scope alone does not satisfy the read-only security requirement. The application must independently reject prohibited operations before execution.
Related policy: Read-Only Integration Security Policy
5. Identity and access control¶
Every integration request must be associated with a verified user identity and an authorized provider connection.
The implementation must validate:
- The authenticated principal.
- The requested operation and its permitted scope.
- The user's authorization for the target resource.
- The association between the user and the provider connection.
- Internal service authentication, where applicable.
User identifiers supplied through request parameters, message content, or model-generated arguments must never independently establish identity or authorization.
Authorization decision flow¶
flowchart TD
REQUEST["Incoming Request"]
IDENTITY{"Identity verified?"}
OPERATION{"Operation allowlisted?"}
RESOURCE{"Resource access authorized?"}
CONNECTION{"User owns or may access connection?"}
EXECUTE["Execute approved operation"]
DENY["Reject request"]
REQUEST --> IDENTITY
IDENTITY -->|No| DENY
IDENTITY -->|Yes| OPERATION
OPERATION -->|No| DENY
OPERATION -->|Yes| RESOURCE
RESOURCE -->|No| DENY
RESOURCE -->|Yes| CONNECTION
CONNECTION -->|No| DENY
CONNECTION -->|Yes| EXECUTE
classDef decision fill:#FFF0D9,stroke:#B87519,color:#70420C,stroke-width:1.5px
classDef success fill:#DDF5E5,stroke:#24804A,color:#174D30,stroke-width:1.5px
classDef denied fill:#FCE8E6,stroke:#B3261E,color:#7F1D1D,stroke-width:1.5px
class IDENTITY,OPERATION,RESOURCE,CONNECTION decision
class EXECUTE success
class DENY denied
Figure 2. Required authorization sequence. A failed or indeterminate check must not proceed to execution.
Authentication or authorization failure must result in rejection, without falling back to a less restrictive execution path.
6. Credential and OAuth security¶
Credentials must be protected throughout their lifecycle, from initial authorization to storage, retrieval, refresh, revocation, and deletion.
| Control area | Requirement |
|---|---|
| Secret storage | Use an appropriate secret-management mechanism and restrict access. |
| Source control | Never commit real credentials, private keys, or production secrets. |
| Token exposure | Keep access and refresh tokens out of frontend responses and ordinary logs. |
| OAuth permissions | Request only the provider permissions required for approved functionality. |
| OAuth state | Validate state and callback handling to protect the authorization flow. |
| Token lifecycle | Handle expiry, refresh failures, revocation, and reconnection safely. |
| Identity binding | Retrieve tokens for the authenticated user and intended provider connection. |
| Incident response | Rotate or revoke credentials when exposure is suspected. |
Least-privilege OAuth
Provider scopes should be as restrictive as practical. However, OAuth permissions do not replace application-level authorization, resource ownership checks, or server-side read-only enforcement.
Do not document a token-storage mechanism, encryption guarantee, or OAuth protection as implemented until the corresponding code and configuration have been reviewed.
7. AI orchestration and prompt-injection security¶
Emails, documents, chat messages, calendar events, issues, attachments, and other retrieved content must be treated as untrusted data.
Retrieved content may contain instructions designed to manipulate the model into disclosing confidential information or requesting unauthorized operations.
Required controls¶
- Separate retrieved content from trusted application instructions.
- Validate model-generated tool names and arguments against server-defined schemas.
- Apply authorization independently of model output.
- Never trust model-generated confirmation flags as proof of user approval.
- Prevent retrieved content from changing security policy or authenticated identity.
- Restrict execution to explicitly authorized operations.
- Test adversarial prompts and malicious retrieved content.
- Avoid exposing secrets or unrelated user data in model context and outputs.
The model is not the security authority
The model may propose an operation, but only the application's trusted policy and authorization layer may approve execution. A model response, retrieved instruction, or generated Boolean flag must not override that decision.
Safe tool-execution pattern¶
Receive request
↓
Establish authenticated identity
↓
Classify intent and prepare a proposed operation
↓
Validate tool name and argument schema
↓
Apply server-side authorization and read-only policy
↓
Resolve the user's authorized provider connection
↓
Execute only if every required check succeeds
↓
Validate the result and return a safe response
This sequence describes the required security behavior. It must be verified against the actual orchestration and integration implementation.
8. Data protection and privacy¶
The application should process only the information necessary to fulfill the user's authorized request.
Security reviews must cover:
- Access restrictions for stored conversations and provider data.
- Database ownership checks and tenant isolation.
- Data minimization in logs, traces, and monitoring.
- Sensitive information included in model prompts and outputs.
- Retention, deletion, and backup requirements.
- Secure handling of attachments and downloaded content.
- Access to backups, deployment artifacts, and diagnostic exports.
| Data category | Primary protection objective |
|---|---|
| OAuth tokens and application secrets | Confidentiality and restricted access |
| Conversations and retrieved documents | User isolation and authorized access |
| Provider responses and attachments | Input validation and controlled processing |
| Logs and diagnostic traces | Data minimization and secret redaction |
| Backups and deployment artifacts | Restricted access and secure retention |
Specific privacy or data-protection guarantees must not be asserted until implementation and deployment configuration have been examined.
9. API and operational security¶
Backend services should enforce security controls consistently across synchronous requests, asynchronous workers, internal communication, and external provider calls.
Recommended control areas include:
- Request validation and bounded payload sizes.
- Authentication and authorization at appropriate enforcement points.
- Bounded pagination, query limits, and execution time.
- Appropriate timeouts, retry budgets, and concurrency controls.
- Safe error responses that do not disclose secrets or internal details.
- Rate limiting where needed.
- Restricted internal service communication.
- Security-relevant logging and monitoring.
- Dependency, container, and secret scanning.
- Secure deployment configuration and access management.
Operational failure behavior¶
| Failure condition | Required behavior |
|---|---|
| Authentication failure | Reject the request. |
| Authorization failure | Do not execute the requested operation. |
| Unknown or prohibited tool | Reject before provider execution. |
| Missing or mismatched provider connection | Reject without using another user's credentials. |
| Unavailable authorization dependency | Fail closed for protected operations. |
| Provider timeout or failure | Apply bounded retries where safe and return a controlled error. |
| Unexpected internal exception | Avoid leaking secrets, tokens, or sensitive implementation details. |
The precise behavior must be verified for each service and execution path. Retries must not cause duplicate side effects if an operation is ever permitted to modify external state in a future phase.
10. Security documentation and related policies¶
Use the following documents to review specific threats and enforcement requirements.
-
Review identified threats, trust boundaries, risk scenarios, and required mitigations.
-
Read-Only Integration Security Policy
Review approved operation boundaries, enforcement requirements, and negative-test acceptance criteria.
These documents define requirements and record security considerations. Their existence does not establish that the application satisfies those requirements.
11. Verification and release readiness¶
A security control should be marked verified only when appropriate evidence demonstrates that it works as intended.
Evidence required for verification¶
- Source-code review of the enforcement point.
- Automated unit and integration tests.
- Negative tests for unauthorized operations.
- Direct endpoint and alternate-path testing.
- Credential handling and OAuth configuration review.
- Dependency and secret scanning.
- Deployment configuration review.
- Documented findings, remediation, and retest results.
Verification status¶
Use the following labels consistently in security reviews and supporting documentation.
| Status | Meaning |
|---|---|
Required |
The control is a defined security requirement. |
Implemented |
An implementation has been identified in the reviewed source. |
Verified |
Appropriate evidence demonstrates that the control works as intended. |
Blocked |
Verification or implementation cannot proceed because of an identified dependency or issue. |
Not verified |
Evidence is insufficient to establish correct behavior. |
These labels describe different levels of evidence. Finding code that appears to implement a control does not, by itself, establish successful runtime behavior.
Release gate
Outstanding high-risk security findings must be assessed and resolved or explicitly accepted by the responsible project authority before release. Acceptance must be documented with the associated risk and rationale.
A successful Zensical documentation build verifies documentation structure and rendering. It does not verify runtime authorization, credential protection, tenant isolation, or provider-side behavior.
12. Continuous improvement¶
Review this security baseline whenever:
- A new integration, provider, or tool is introduced.
- An endpoint, worker, or execution path changes.
- OAuth scopes or credential-handling logic changes.
- Authentication or authorization logic changes.
- A security finding or incident is discovered.
- Deployment architecture, data retention, or data handling changes.
Update the security overview, threat model, integration policies, and regression tests together so that documented requirements remain aligned with verified implementation behavior.
Next steps
Read the Threat Model Review the Read-Only Integration Policy
Security baseline for WhiteLotusAI. Implementation and runtime verification remain subject to evidence-based review.