Context Gateway for AI Systems

Control what your
AI can see.

LeanCTX sits between AI and the systems it reads. It selects relevant context, applies supported controls, and records what the integration can observe.

As of
installs & downloads
360,013
GitHub stars
3,871

Starred by engineers at

  • Google
  • Microsoft
  • Amazon
  • IBM
  • Red Hat
  • Tencent
  • Autodesk
  • Dynatrace
  • Dell
  • VTEX
  • Zühlke

Individual GitHub stars, not company endorsements.

LeanCTX in action

See what reaches
your model.

Useful context in. Sensitive details under your rules. Follow one task from source access to the information delivered to your AI.

Illustrated workflow · sample data

The task

Find how the invoice total is calculated.

Sources & rules

  • src/billing/total.ts

    Relevant code

    The implementation behind the task.

  • logs/billing.log

    Filtered result

    Email and customer ID masked by configured rules.

  • exports/customers.csv

    Access denied

    Excluded by the source-access policy.

Prepared for the model

The code you need.
Customer fields stay out.

export function total(net: number, rate: number) {
  return Math.round(net * (1 + rate) * 100) / 100;
}

Filtered diagnostic context

event=invoice_total
email=[REDACTED]
customer_id=[REDACTED]

Source: total.ts · relevant implementation

Inspect this example

Rules in this example

  • Allow the billing source and diagnostic log; deny the customer export.
  • Mask the email field and customer_id matches in supported read results.
  • Deliver the relevant implementation and filtered diagnostic context.

Fictional source excerpt

event=invoice_total
[email protected]
customer_id=SAMPLE-042

Source inspection and model delivery are separate. A permitted file may be read locally so its returned content can be filtered.

The task

Which support procedure applies to a sync timeout?

Sources & rules

  • runbooks/sync-timeout · v3

    Current source

    The runbook marked current for this workflow.

  • runbooks/sync-timeout · v2

    Not selected

    Superseded version retained as a reference.

  • customer-records/

    Access denied

    Outside this user’s permitted source scope.

Prepared for the model

The current procedure.
With the right access.

Retry the sync once.
If the timeout returns, stop and escalate.

Source reference

source=runbooks/sync-timeout
version=v3
status=current

Source: sync-timeout · v3 · recovery procedure

Inspect this example

Rules in this example

  • Use the sources authorized for this user and task.
  • Select the version explicitly marked current in the source metadata.
  • Keep the source reference with the prepared procedure.

Fictional source excerpt

v3 · Current: retry once, then escalate.
v2 · Superseded: continue retrying.

Source inspection and model delivery are separate. A permitted file may be read locally so its returned content can be filtered.

Access rules control the source. Configured filters control supported read results.

Explore how it works

Select. Control. Prove.

Select the context.
Control delivery. Inspect the evidence.

A clear path from task-relevant information to supported controls and the evidence your integration can observe.

Select

Choose task-relevant context.

Select permitted information for the task, prepare the needed detail and keep references to its sources.

Explore the complete flow
Choose task-relevant context.Select permitted information for the task, prepare the needed detail and keep references to its sources.
Permitted sourcesTask-relevant contextSource references

Control

Apply supported rules before delivery.

Use the source permissions, configured content checks and budgets supported by the active integration.

Explore the complete flow
Apply supported rules before delivery.Use the source permissions, configured content checks and budgets supported by the active integration.
Available informationRules & budgetPrepared context

Prove

Inspect the evidence the integration can observe.

Review source references, policy outcomes and recorded usage; in context-only integrations, the host owns the model call.

Explore the complete flow
Inspect the evidence the integration can observe.Review source references, policy outcomes and recorded usage; in context-only integrations, the host owns the model call.
Source evidencePolicy outcomesRecorded usage

Keep your systems. Add the Context Gateway.

Your AI systems.
Your applications stay yours.

Keep your application, agent loop and model. Use LeanCTX for context alone or extend control to supported model and tool requests.

Context service

Prepare context. Keep your model call.

Let LeanCTX retrieve, shape and filter context. Your application receives the prepared result and decides how to use it.

Your applicationTask and permitted sources
LeanCTXRetrieval, context budget and read filters
Your model callPrepared context with source references

You retain control of model execution.

Supported model requests

Route eligible requests through your gateway.

Use the configured gateway for supported model requests. Enterprise adds organization identity, policy and reporting. Coverage depends on the selected release and integration.

Your AI workflowTask, context and execution policy
LeanCTXConfigured provider routes and proxy budgets
Permitted model or toolSupported requests through the gateway

Verify support for the selected release and integration.

Coding teams

Keep your tools and repositories.

Use the open-source Engine locally or through configured provider and proxy routes for supported requests. Context-only use needs no hosted service. Routing, proxy budgets and other controls depend on the configured integration; local processing does not mean local inference.

Start with the Engine

AI product builders

Put context control in your product.

Embed supported Engine capabilities through five stable SDK primitives and six Agent Tools language contracts. Preview operations stay in the Python namespace leanctx_sdk.preview. Production and OEM rights require a separate signed written agreement.

Explore SDK / OEM

Enterprise buyers

Control company context across AI workflows.

Enterprise is the commercial offer for organization identity, policy and reporting across supported AI workflows. Deployment, retention and support depend on the licensed release and agreement.

Explore Enterprise

Local context processing does not mean local inference. Your model and deployment choices determine where model requests are processed.

Security in the context flow

Your rules. Before the handoff.

Relevant information is not automatically permitted information. Bound file access, inspect sensitive content and define how LeanCTX responds to detected matches.

PathJail

Set the boundaries.

Keep reads within allowed directories. PathJail checks resolved paths, including symlinks and traversal attempts. It is an application-level check, not an OS sandbox, and cannot eliminate operating-system or race-condition limits.

Read-time checks

Inspect before delivery.

Enable checks for supported text results: known injection patterns and personal-data formats. Secret redaction and custom patterns add to your rules.

Filter rules & audit

Choose the response.

Warn, redact or block detected content. Filter metadata reports categories and counts, without sensitive matched values. Audit detail depends on the call.

LeanCTX SDK

Your product.
The same engine.

Build Context Intelligence into your application, copilot or agent. The SDK connects your code to a compatible LeanCTX Engine through supported interfaces. Use its capabilities inside your own product, locally or with a compatible remote deployment.

Explore the SDK
Context Intelligence for your own applicationsApplications, copilots and agentic apps connect to the Engine through the LeanCTX SDK. Your product uses context, execution controls and portable state.
LeanCTX SDKContext. Control. Continuity.

Wavect · In practice

Real work.
Measured impact.

Wavect used LeanCTX in its development workflow and reported less context and lower estimated token costs. A field report you can compare with your own work.

Read the field report
less context
64.1%
lower estimated token costs
56.6%

Reported snapshot: July 26, 2026. Observations from this workflow; not audited provider invoices or a promised saving.

Start with LeanCTX

Start with one real workflow.

Connect your sources. Set your rules. See what LeanCTX changes in your own AI workflow.

Your application. Your sources. Your rules.