Agent Integration Proxy

Protect remote agents by pointing them to the Njira Gateway.

Enable Njira-AI protection for your remote AI agents with a few lines of configuration.

Overview

Njira-AI acts as a transparent proxy. Point your LLM client (OpenAI, Anthropic, etc.) to the Njira Gateway instead of the provider API. This allows Njira to intercept, audit, and enforce policies on every request before it reaches the upstream model.

Quick Start

Python (OpenAI Client)

from openai import OpenAI

client = OpenAI(
    # Point to your Njira Gateway instance
    base_url="http://localhost:8080/v1", 
    # Use your Njira API Key (starts with nj_live_ or nj_test_)
    api_key="nj_live_abcdef123456"       
)

# Make requests as normal
# Njira seamlessly intercepts, audits, and enforces policies
response = client.chat.completions.create(
    model="gpt-5.2",
    messages=[{"role": "user", "content": "Hello world"}],
    extra_headers={
        "X-Njira-Tier": "standard",  # Optional: Request specific capability tier
        "X-Tool-Name": "chat_interface"
    }
)

TypeScript (OpenAI Client)

import OpenAI from 'openai';

const client = new OpenAI({
  baseURL: 'http://localhost:8080/v1',
  apiKey: 'nj_live_abcdef123456',
});

// Requests are routed through Njira
const completion = await client.chat.completions.create({
  messages: [{ role: 'user', content: 'Hello world' }],
  model: 'gpt-5.2',
});

Handling Verdicts

Njira-AI returns standard HTTP status codes:

✅ 200 OK (ALLOW / MODIFY)

Request was safe and forwarded to the LLM. If a MODIFY verdict occurred (e.g., PII redacted), the response content will transparently contain the safe, redacted/modified version.

🚫 403 Forbidden (BLOCK)

Request violated a safety policy and was blocked.

Response Body:

{
  "blocked": true,
  "reason": "PII_GUARD: Credit card number detected",
  "reason_code": "PII_DETECTED",
  "request_id": "req_123abc...",
  "verdict_urn": "urn:njira:verdict:block:..."
}

Advanced Configuration

Pass these optional headers to control Njira behavior:

Header Description Example
X-Njira-Tier Request specific model capability (fast, standard, strong) fast
X-Policy-Id Enforce a specific policy pack finance_guard
X-Tool-Name Tag the source tool/agent for audit logs search_tool
X-Tenant-Id Override tenant context (requires Admin key) tenant_xyz

Shadow Mode

If your Organization is in Shadow Mode, Njira will never return a 403. Instead, it logs the BLOCK verdict but forwards the request.

Response Headers in Shadow Mode:

  • X-Njira-Shadow-Verdict: BLOCK or MODIFY
  • X-Njira-Shadow-Reason: The reason code (e.g., PROMPT_INJECTION)

Use this to test integration safely in production.