ibexharness
DocsBlogReleasesRoadmap
GitHub
ibexharness

Documentation

Security overviewAuthenticationTenant isolationSecrets and keys
Security›Security overview
Security

Security overview

Security objectives S1–S6, threat model summary, and Phase 1 validated invariants.

IBEX Harness sits on a high-value data path — LLM traffic, persistent memory, org-scoped tokens, and billing events. Security is an invariant, not a phase. This page summarizes what must always be true and what we defend against in Phase 1 (auth + proxy).

Phase 1 scope

Phase 1 validates auth, agent identity, rate limits, and error envelopes via the security-integration CI job. Memory injection defenses and dashboard MFA ship in later phases.

Security objectives

These six objectives (S1–S6) are non-negotiable across every release.

1

S1 — Tenant isolation

Org A must never access Org B data via API, database, cache, logs, analytics, or exports. Cross-tenant resource access returns 403 (PERMISSION_DENIED), never 404.

2

S2 — Confidentiality of secrets

Tokens, API keys, passwords, and signing keys must never appear in git history, logs, crash dumps, analytics payloads, or client-side bundles.

3

S3 — Integrity of billing and audit records

Billing events and audit logs are append-only, tamper-resistant, and recorded at least once — never silently dropped.

4

S4 — Least privilege authorization

Authentication is not authorization. Every operation checks token validity, permission bitmap, org ownership, and explicit roles for sensitive actions.

5

S5 — Safe prompt and memory handling

Memory content is untrusted input. Write-time quarantine, retrieval-time delimiters, and directive rules prevent prompt injection from stored content.

6

S6 — Secure failure modes

Auth and tenant isolation fail closed. Memory and context injection fail gracefully (degraded quality, still safe). Missing checks never accidentally allow operations.

Threat model summary

Mermaid diagram: graph TB
+-----------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------+                                           
|                                                External threats                                                 | |                                         Internal threats                                           | |                                              AI-specific threats                                               |                                           
|                                                                                                                 | |                                                                                                    | |                                                                                                                |                                           
|                                                                                                                 | |                                                                                                    | |                                                                                                                |                                           
| +-----------------------+     +-----------------------+     +-----------------+     +-------------------------+ | | +------------------------------+     +----------------------------+     +------------------------+ | | +----------------------------+     +----------------------------------------+     +--------------------------+ |   +----------+     +----------+     +----+
| |                       |     |                       |     |                 |     |                         | | | |                              |     |                            |     |                        | | | |                            |     |                                        |     |                          | |   |          |     |          |     |    |
| |   Stolen API tokens   |     |  Credential stuffing  |     | API abuse / DoS |     | Supply-chain compromise | | | | Misconfigured service tokens |     | Developer isolation bypass |     | Logging PII or secrets | | | | Prompt injection in memory |     | Instruction smuggling via integrations |     | Data poisoning over time | |   | external |     | internal |     | ai |
| |                       |     |                       |     |                 |     |                         | | | |                              |     |                            |     |                        | | | |                            |     |                                        |     |                          | |   |          |     |          |     |    |
| +-----------------------+     +-----------------------+     +-----------------+     +-------------------------+ | | +------------------------------+     +----------------------------+     +------------------------+ | | +----------------------------+     +----------------------------------------+     +--------------------------+ |   +----------+     +----------+     +----+
|                                                                                                                 | |                                                                                                    | |                                                                                                                |         |                |             |  
+-----------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------+         |                |             |  
              +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------+             |  
              |                                                                                                                                                                                                                                                                                                                                                                      |  
              v                                                                                                                                                                                                                                                                                                                                                                      |  
  +-----------------------+     +-----------------------+                                                                                                                                                                                                                                                                                                                            |  
  |                       |     |                       |                                                                                                                                                                                                                                                                                                                            |  
  | Proxy + Auth boundary |     | Memory / Context path |<---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+  
  |                       |     |                       |                                                                                                                                                                                                                                                                                                                               
  +-----------------------+     +-----------------------+                                                                                                                                                                                                                                                                                                                               
              |                                                                                                                                                                                                                                                                                                                                                                         
              |                                                                                                                                                                                                                                                                                                                                                                         
              +-----------------------------+                                                                                                                                                                                                                                                                                                                                           
              |                             |                                                                                                                                                                                                                                                                                                                                           
              v                             v                                                                                                                                                                                                                                                                                                                                           
  +-----------------------+     +-----------------------+                                                                                                                                                                                                                                                                                                                               
  |                       |     |                       |                                                                                                                                                                                                                                                                                                                               
  |       Auth gRPC       |     |    Redis rate limit   |                                                                                                                                                                                                                                                                                                                               
  |                       |     |                       |                                                                                                                                                                                                                                                                                                                               
  +-----------------------+     +-----------------------+                                                                                                                                                                                                                                                                                                                               
              |                                                                                                                                                                                                                                                                                                                                                                         
              |                                                                                                                                                                                                                                                                                                                                                                         
              |                                                                                                                                                                                                                                                                                                                                                                         
              |                                                                                                                                                                                                                                                                                                                                                                         
              |                                                                                                                                                                                                                                                                                                                                                                         
              v                                                                                                                                                                                                                                                                                                                                                                         
  .-----------------------.                                                                                                                                                                                                                                                                                                                                                             
  |                       |                                                                                                                                                                                                                                                                                                                                                             
  |     Postgres + RLS    |                                                                                                                                                                                                                                                                                                                                                             
  |                       |                                                                                                                                                                                                                                                                                                                                                             
  |                       |                                                                                                                                                                                                                                                                                                                                                             
  '-----------------------'                                                                                                                                                                                                                                                                                                                                                             
CategoryExamplesPrimary controls (Phase 1)
ExternalToken theft, brute force, cost amplificationPAT hashing (Argon2id), org RPM limits, input size caps
InternalBroad service tokens, missing org filtersRLS + application-layer org checks, bounded permission bitmap
AI-specificInjection stored in memory, role confusionQuarantine thresholds (Phase 2+), nonce-wrapped retrieval

ClickHouse has no RLS

Analytics queries must include an explicit org_id filter. A query guard rejects statements missing tenant scope in production.

Fail closed vs fail open

ScenarioBehavior
org_id context not setFail closed — deny access
Token validation incomplete (no safe cache)Fail closed — 503 AUTH_UNAVAILABLE
Permission check ambiguousFail closed — 403
Redis unavailable (rate limit)Fail open — allow request, log warning (ADR-0015)
Memory retrieval timeoutFail open — directive-only context

Never disable controls to recover

Do not temporarily disable auth, rate limits, or RLS during incidents. Prefer rollback, scale-up, or circuit breakers.

Phase 1 validated invariants

The following behaviors are enforced by automated security tests in CI:

InvariantExpected behavior
Missing or invalid tokenRejected before handler (401)
Cross-org agent header403, not 404
Revoked tokenRejected promptly
Auth service down503 with stable JSON envelope
Rate limitsPer-org RPM with correct headers
Permission bitmapEnforced on protected routes

Related pages

  • Authentication — token types and fail-closed pipeline
  • Tenant isolation — RLS and Redis namespacing
  • Secrets and keys — rotation and env var contract
  • Auth service — gRPC validation surface

Was this page helpful?

Edit on GitHub

Last updated on

PreviousSecurityNextAuthentication

On this page

  • Security objectives
  • Threat model summary
  • Fail closed vs fail open
  • Phase 1 validated invariants
  • Related pages
0%