IBEX Harness
DocsBenchmarksBlogChangelogRoadmap
GitHub
IBEX Harness

Documentation

IntroductionQuickstart (5 minutes)ConceptsFAQ
Getting Started›Concepts
Getting Started

Concepts

Core ideas behind the proxy, auth service, and Phase 2 platform features.

IBEX Harness separates who is calling (organization + agent), what they may do (permissions), and where requests go (proxy routing + provider mode). Understanding these axes is enough to integrate against the shipped auth + proxy surface.

Shipped vs planned

Auth, proxy forwarding (mock/live), directives, sessions, idempotency, auth cache, and ClickHouse traces are shipped. Memory injection, vector search, and the Python dashboard remain Phase 3+. See current state.

Platform vocabulary

TermMeaningStatus
OrganizationTop-level tenant; owns agents, tokens, rate limitsShipped — glossary
AgentAutonomous actor inside an org; identified per requestShipped
PATPersonal Access Token — ibex_pat_* bearer credentialShipped
RLSPostgres row-level security isolating tenant rowsShipped
ProxyHTTP edge — auth, rate limit, inject, forwardShipped
DirectiveOrg behavioral instructions injected into chatShipped — Directives
SessionConversation lifecycle + checkpointsShipped — Sessions
MemoryPersistent agent knowledge storeNot shipped (Phase 3)

Core entities

1

Organization

Every token belongs to exactly one organization (org_id). Rate limits, RLS policies, and future billing boundaries scope per org. Table: ibex_core.organizations.

2

Agent

An agent is an autonomous actor inside an org. The proxy requires X-IBEX-Agent-ID on protected routes and validates it via auth gRPC ValidateAgent.

3

Token (PAT)

Clients authenticate with a Personal Access Token. The proxy calls ValidateToken (optionally via bloom+LRU cache); Argon2id verifies the secret server-side. Permissions are a 64-bit bitmap (ADR-0009).

4

User

Human operator linked to org membership. Used for token audit trails; dashboard login is future work.

Entity relationships: Org and project model and Data model.

Request path (today)

Mermaid diagram: sequenceDiagram
+--------+                                     +-------+                              +------+    +-------+    +-----+   
| Client |                                     | Proxy |                              | Auth |    | Redis |    | LLM |   
+--------+                                     +-------+                              +------+    +-------+    +-----+   
     |                                             |                                      |           |           |      
     |  Bearer PAT + X-IBEX-Agent-ID + JSON body   |                                      |           |           |      
     |--------------------------------------------->                                      |           |           |      
     |                                             |                                      |           |           |      
     |                                             |  ValidateToken (cache miss → gRPC)   |           |           |      
     |                                             |-------------------------------------->           |           |      
     |                                             |                                      |           |           |      
     |                                             |         org_id, permissions          |           |           |      
     |                                             <......................................|           |           |      
     |                                             |                                      |           |           |      
     |                                             |   ValidateAgent(org_id, agent_id)    |           |           |      
     |                                             |-------------------------------------->           |           |      
     |                                             |                                      |           |           |      
     |                                             |             authorized               |           |           |      
     |                                             <......................................|           |           |      
     |                                             |                                      |           |           |      
     |                                             |                rate limit check      |           |           |      
     |                                             |-------------------------------------------------->           |      
     |                                             |                                      |           |           |      
     |                                             |                allowed / denied      |           |           |      
     |                                             <..................................................|           |      
     |                                             |                                      |           |           |      
     |                                             +---+                                  |           |           |      
     |                                             |   | resolve directive + session      |           |           |      
     |                                             <---+                                  |           |           |      
     |                                             |                                      |           |           |      
     |                                             |                  mock stub or live forward       |           |      
     |                                             |-------------------------------------------------------------->      
     |                                             |                                      |           |           |      
     |                                             |                         completion   |           |           |      
     |                                             <..............................................................|      
     |                                             |                                      |           |           |      
     |      200 (+ async checkpoint / trace)       |                                      |           |           |      
     <.............................................|                                      |           |           |      
     |                                             |                                      |           |           |      
+--------+                                     +-------+                              +------+    +-------+    +-----+   
| Client |                                     | Proxy |                              | Auth |    | Redis |    | LLM |   
+--------+                                     +-------+                              +------+    +-------+    +-----+   

Full lifecycle documentation: Request lifecycle.

Required headers

Protected proxy routes require:

Authorization: Bearer ibex_pat_<uuid>_<secret>
X-IBEX-Agent-ID: <agent-uuid>
Content-Type: application/json   # POST bodies only

Optional: Idempotency-Key on non-streaming chat when Redis is configured.

bash
curl -X POST http://localhost:8080/v1/chat/completions \
  -H "Authorization: Bearer ${IBEX_DEV_TOKEN}" \
  -H "X-IBEX-Agent-ID: ${IBEX_DEV_AGENT_ID}" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-4o","messages":[{"role":"user","content":"ping"}]}'

Default mock mode expected response: HTTP 200. Use IBEX_LLM_MODE=live plus OPENAI_API_KEY for real provider responses.

Org from token

Chat uses POST /v1/chat/completions without {org_id} in the URL. Tenant scope comes from the PAT, not the path.

Provider modes

ModeWhenResult
mock (default)Local/dev without a provider keyIn-process stub → HTTP 200
liveOPENAI_API_KEY setForward to OpenAI-compatible /chat/completions

Mock is not allowed when IBEX_ENV=production. Unregistered models return 501 PROVIDER_NOT_CONFIGURED.

Permission model

Permissions are bitwise flags on the token. Integrators need at minimum:

PermissionRequired for
ProxyChatCompletionChat completion endpoint
TokenCreateIssuing new PATs via gRPC

Admin seed tokens include broader bits for local development. Production tokens should follow least privilege — Authentication.

Error envelope

All JSON errors share a stable shape:

JSON
{
  "error": {
    "code": "RATE_LIMITED",
    "message": "Rate limit exceeded",
    "request_id": "0192a3b4-c5d6-7890-abcd-ef1234567890"
  }
}

Semantic validation adds field_errors[]. Use request_id to correlate with proxy and auth logs. Reference: API errors.

Multi-tenancy principles

1

org_id from token

Never trust org_id from request body or unvalidated URL segments.

2

403 not 404

Cross-tenant access returns Forbidden — ambiguous to attackers.

3

Defense in depth

Middleware, gRPC, store WHERE clauses, and Postgres RLS all enforce isolation.

4

Redis + ClickHouse namespacing

Redis keys include org_id; every ClickHouse query must filter org_id explicitly.

Details: Tenant isolation and Multi-tenant RLS.

Future concepts (not yet available)

  • Context assembly — parallel directive + memory retrieval (40ms budget)
  • Memory service — vector search, dedup, conflict detection
  • Embedder — text-to-vector for semantic recall
  • Worker — async extraction, fingerprinting, drift detection

Treat these as design targets when reading Architecture overview — not integration endpoints.

Mental model summary

Mermaid diagram: flowchart LR
+---------------+     +-------+                  +---------------------+
|               |     |       |                  |                     |
|               |     |       |                  |                     |
|     Client    |---->| Proxy |      ---gRPC---->|         Auth        |
| (PAT + Agent) |     |       |                  |                     |
|               |     |       |                  |                     |
+---------------+     +-------+                  +---------------------+
                          :                                 |           
                          :                                 |           
                          :                                 |           
                          :                                 |           
                          :                                 v           
                          :                      +---------------------+
                          :                      |                     |
                          :                      |                     |
                          +--------------------->|       Postgres      |
                          :                      |      SQL + RLS      |
                          :                      |                     |
                          :                      +---------------------+
                          :                                             
                          :                                             
                          :                                             
                          :                                             
                          :                                             
                          :                      +---------------------+
                          :                      |                     |
                          :                      |                     |
                          +--------------------->|        Redis        |
                          :                      | rate limits + cache |
                          :                      |                     |
                          :                      +---------------------+
                          :                                             
                          :                                             
                          :                                             
                          :                                             
                          :                                             
                          :                      +---------------------+
                          :                      |                     |
                          +-----mock-/-live----->|     LLM provider    |
                          :                      |                     |
                          :                      +---------------------+
                          :                                             
                          :                                             
                          :                                             
                          :                                             
                          :                                             
                          :                      +---------------------+
                          :                      |                     |
                          +......Phase.3+.......>|   Memory / Context  |
                                                 |                     |
                                                 +---------------------+

Related guides

  • Introduction — what works today vs roadmap
  • Quickstart — five-minute local setup
  • Auth overview — gRPC surface
  • Proxy overview — middleware and endpoints
  • Glossary — term definitions

Was this page helpful?

Edit on GitHub

Last updated on

PreviousQuickstart (5 minutes)NextFAQ

On this page

  • Platform vocabulary
  • Core entities
  • Request path (today)
  • Required headers
  • Provider modes
  • Permission model
  • Error envelope
  • Multi-tenancy principles
  • Future concepts (not yet available)
  • Mental model summary
  • Related guides
0%