# KELS > KELS is a governed read gateway for MongoDB. Apps and AI agents call reviewed, signed queries by ID, with typed values, instead of holding database credentials. The KELS agent runs inside the customer's network and is the only part that touches data; the KELS cloud sees only metadata. Current version: 0.3.1 (design-partner pilots). Website: https://kels.io/ · Contact: hello@kels.io · Last updated: 2026-11-07 ## The problem it solves To let an AI agent or app answer questions from a database, most teams hand it a MongoDB connection string. It can then read everything that user can read, for every customer, with queries nobody reviewed. KELS replaces the connection string with a short list of published queries the agent may call. | Question | With a connection string | With KELS | | --- | --- | --- | | What can it run? | Any query it writes | Only queries a person reviewed, tested and published, called by ID | | Whose records? | Every customer in the database | Only the customer (tenant) it was granted; the KELS agent adds that filter itself | | Passwords, tokens, ID numbers? | Returned if asked for | Restricted fields can never be queried; Sensitive fields can need an approval | | Where do credentials live? | In the agent's prompt, config or tools | Only in the KELS agent inside your network; the AI agent holds a revocable API key | | What can you see afterwards? | Database logs, if enabled | Every run: who, which query, which customer, why; hash-chained audit trail | ## How it works Three parts: - **KELS cloud** (hosted): the portal where a team classifies fields, reviews and publishes queries, approves requests and reads the audit trail. - **KELS agent** (in the customer's network, next to MongoDB): checks the signature, API key, tenant and every value, runs the query with a read-only database user and filters the result. It opens every connection to the cloud; nothing connects in. - **The customer's app or AI agent**: calls `POST /v1/execute` on the KELS agent with a query ID, version, tenant, purpose code and typed parameters. The cloud sees: field names, types and index names; hints such as "looks like an email" (never the value); published queries; run records (query, status, row counts, timings). Never leaves the customer's network: document values, result rows, parameter values, connection strings, hosts, users, passwords, and the agent's local audit log. ## Setting up a query, in four steps 1. **Connect the database.** Install the KELS agent (signed .deb or .rpm, x86_64 Linux) and run `sudo kels-agent setup`; an admin approves each database in the portal. 2. **Mark what is sensitive.** KELS lists every field and suggests Ordinary, Sensitive or Restricted from what it sees (emails, phone numbers, card numbers, Aadhaar and Social Security numbers). Unclassified fields are never returned. 3. **Write, test, publish.** A query is drafted, run on staging, and published by a different person from its author. It gets an ID and a version, is signed, and gets a plain-English summary. 4. **Call it.** The portal generates ready-to-run code in curl, Python, Java, Kotlin, Go, C#, Node.js and Rust. No KELS SDK to install. Example request: ```json { "query_id": "", "query_version": 3, "data_tenant_id": "clinic-0042", "purpose_code": "care_planning", "parameters": { "month": { "type": "date", "value": "2026-10-01T00:00:00Z" } } } ``` Example refusals: another tenant → `TENANT_DENIED` (403); an operator smuggled into a value → `PARAMETER_TYPE_MISMATCH` (422); a query over Sensitive data → `APPROVAL_REQUIRED` (202, waits for a person). ## Features in 0.3.1 - Catalog without values - Classification - Drift detection - Freshness per project - Draft, stage, publish - Signed, versioned IDs - Plain-English summaries - Query building blocks - Customer isolation - Typed values - Approvals - Result guard and row cap - Fails closed - Agent in your network - Self-checks - Keys, scopes and roles - Audit trail Query building blocks: filters (equal, not equal, in, not in, exists, ranges), grouping with count, sum, average, min and max, sorting, paging, and date buckets by day, week, month or year in any time zone. ## Requirements - MongoDB replica set (self-hosted or Atlas) with at least one secondary; tested on MongoDB 8.2. One database user with only the built-in `read` role. - A Linux x86_64 machine near the database: Ubuntu 22.04/24.04, Debian 12, RHEL, Rocky or Alma 8/9, Amazon Linux 2023. Suggested start: 2 CPUs, 2 GB memory. Outbound HTTPS to the KELS cloud. ## Who it is for - Teams replacing the MongoDB Atlas Data API and custom HTTPS endpoints (end of life September 2025): HTTP calls by query ID, no database credentials in the caller. - B2B SaaS teams shipping AI assistants over customer data: per-customer isolation and approvals for sensitive data. - Security and compliance leads: reviewed, signed and audited access. KELS helps meet HIPAA and SOC 2 access controls; it does not make anyone compliant on its own. ## Not yet available (planned for 1.0) MCP server for AI agents, natural-language query drafting (a person and rules still decide what runs), joins and array fields. After 1.0: single sign-on, Windows agent. ## Questions ### Does my data go to your cloud? No. Documents, results and the values in requests stay in your network. The cloud sees field names, types and run records so your team can review and audit. ### Do I have to change my database or my app? Your database stays as it is; KELS only needs one read-only user. Your app replaces its database query with an HTTP call to the KELS agent. ### What do I install? One package on a Linux machine near the database (x86_64; Ubuntu, Debian, RHEL, Rocky, Alma or Amazon Linux). We suggest 2 CPUs and 2 GB of memory to start. ### Which databases does it work with? MongoDB replica sets, self-hosted or Atlas. KELS is tested on MongoDB 8.2. ### Can an AI agent write its own queries? Not today. Agents call queries your team has published. From KELS 1.0 an AI can draft queries, but your rules and a person still decide what runs. ### Is KELS HIPAA compliant? No product is compliant on its own. KELS helps you meet HIPAA and SOC 2 access controls with reviewed queries, least privilege and a full audit trail. ### What does it cost? Pilots are arranged with each team. Talk to us and we will work out what fits. ## Getting access KELS is in design-partner pilots: 8 weeks on the team's own data, with 2 agents, 10 collections, 5 seats, 25 published queries and 100,000 runs a month. Join the waitlist at https://kels.io/#waitlist or write to hello@kels.io.