AJEN PUBLIC TRUST CENTER & SECURITY ARCHITECTURE

Built for IT audit sign-off before a single SKU syncs.

Wholesale distributors trust AJEN with multi-godown stock positions, supplier pricing, and GST tax classifications. Every connector boundary, AI permission tier, and tenant database policy is enforced deterministically in code and verified across 123 automated security tests.

1. End-to-End Topology

Outbound-Only TallyPrime Data Flow

Zero Inbound Firewall Ports Opened
STAGE 01 · CUSTOMER WINDOWS HOST

TallyPrime + Windows Service Connector

  • •Reads TallyPrime XML locally over loopback 127.0.0.1:9000 only.
  • •Stores pairing token encrypted with AES-256-GCM & scrypt-machine-v1 key derivation.
  • •Initiates strictly outbound TLS 1.3 HTTPS requests to AJEN API.
STAGE 02 · NESTJS GUARD & MATH LAYER

Authenticated Control & FAIL_CLOSED Gate

  • •Derives organizationId strictly from verified Supabase JWT / SHA-256 connector bearer hash (never request body).
  • •Runs RBAC permissions (PermissionsGuard) and Zod schema validation on every endpoint & agent tool call.
  • •Enforces FAIL_CLOSED staleness & control-total reconciliation checks before reorder execution.
STAGE 03 · SUPABASE POSTGRESQL RLS

Row-Level Isolation & Immutable Audit

  • •Every customer-owned table enforces organization_id = current_tenant_id() RLS policies.
  • •Least-privilege policies split read access from manager approvals and audit log writes.
  • •Append-only audit_logs capture every agent tool call, policy gate block, and human signature.
2. Bounded Agent Autonomy

AI Action Boundaries (Levels L0–L3)

Workspace Control:Approved Workflow: ON / PAUSED
AJEN AI Agent action boundary levels L0 through L3
Boundary TierOperational ScopeAllowed OperationsMandatory Technical Control
L0 · Read & MathDeterministic Stock & GST EngineGodown stock position, 14d/30d/90d demand velocity, MOQ/pack-size rounding, CGST+SGST/IGST splits, and aging buckets.Pure server-side TypeScript arithmetic. LLMs never execute arithmetic or arbitrary SQL queries.
L1 · Scrubbed DraftsUntrusted Input Isolation & DraftingParses PDF/WhatsApp POs, supplier invoices, and CSV sheets into strictly unapproved DRAFT records.PromptSanitizerService wraps ERP text inside <untrusted_erp_data> tags; CWE-1236 strips leading = + - @ formula triggers.
L2 · Approval LockHuman-in-the-Loop Financial GatePurchase orders, Sales Order approvals, Supplier Debit Notes, and Inter-Godown Transfer orders.Approvals bind to a cryptographic SHA-256 version_hash of prices, quantities, and tax lines (HTTP 409 on drift).
L3 · Gated SyncIdempotent TallyPrime Write-Back & Kill-SwitchEnqueues approved vouchers for Tally XML import (REMOTEID idempotency) and approved dispatch drafts.Strictly requires APPROVED state plus active tenant workflow switch; instantly halted by the Approved Workflow: PAUSED control.
3. Infrastructure Transparency

Subprocessor & Hosting Matrix

Infrastructure and subprocessor inventory
LayerService / ProviderPrimary RegionProcessing PurposeSecurity & Data Guarantees
Database & AuthSupabase (PostgreSQL + Auth)ap-south-1 (Mumbai, India)Multi-tenant ERP ledger storage, JWT issuance, and PostgreSQL RLS enforcement.TLS in transit, AES-256 at rest, strict current_tenant_id() RLS policies on all tenant tables.
AI Inference GatewayServer-Side LLM Provider APIConfigured API EndpointNatural-language order parsing, data-analysis briefs, and collection message drafting.Zero model training on customer data, tool-allowlist enforcement, monthly token & USD cost hard caps.
Background QueueRedis & BullMQPrivate App Network / VPCAsynchronous sync jobs, recommendation sweeps, and write-back polling state.Authenticated password/TLS connection; stores job IDs and pointers rather than raw credentials.
Application RuntimeNext.js Web + NestJS API Containersap-south-1 / Customer VPCSSR customer workbench, RBAC guards, Zod validation, and Tally connector API.Non-root Node 20 containers, rate limiting, structured security exception filtering (zero SQL error leaks).
4. Customer Sovereignty Controls

How to Revoke Access Immediately

Tenant Administrators retain unilateral control to cut off ERP sync, halt agent execution, or initiate full organization offboarding in seconds.

ACTION A · CONNECTOR CUTOFF

Revoke Tally Connector Token

Navigate to /settings/integrations to mark the active connector REVOKED (invalidates bearer token immediately), or stop the local service via ajen-connector uninstall-service.

ACTION B · AGENT KILL-SWITCH

Pause All Automated Workflows

Open /settings/agent or the header status badge and toggle Approved Workflow: PAUSED. Blocks all agent runs, AI drafts, and queued Tally XML dispatches instantaneously with an audit reason logged.

ACTION C · DPDP OFFBOARDING

Export Data & Purge AI History

Visit /settings/security to trigger a self-service JSON Data Portability Export, purge conversational AI memories, or execute full tenant offboarding and connector revocation.