Skip to main content

AIRiskGuard Gateway

PyPI License: MIT Python 3.10+

AI traffic management for developer teams. A local HTTPS proxy that sits between your developers and AI provider APIs — routing, logging, and protecting every AI call.

Free (MIT) · pip install · works with Claude Code, Cursor, Copilot, any AI tool

What it does

  • Smart routing — route PII to an internal model, financial data to Azure, simple queries to cheaper models. Rules in plain YAML.
  • Cost dashboard — see spend by model, by day, by team. Know your AI bill before it arrives.
  • Secrets + PII protection — blocks API keys, SSNs, credit cards, and financial data before they reach external APIs.
  • Model allowlist — define which models your team can use. Everything else is blocked at the proxy.
  • Session stickiness — conversations stay on the same model. No broken contexts when routing changes.

Quickstart

pip install airiskguard-gateway
airiskguard-gateway install-cert
airiskguard-gateway start

Then in your shell (add to ~/.zshrc or ~/.bashrc):

export HTTPS_PROXY=http://127.0.0.1:8080
export NODE_EXTRA_CA_CERTS=~/.config/airiskguard-gateway/mitmproxy-ca-cert.pem

That's it. Every AI call through Claude Code, Cursor, or any tool now passes through the gateway.

Configuration

Config lives at ~/.config/airiskguard-gateway/config.yaml. Generate the default:

airiskguard-gateway config init

Key settings:

on_secrets_detected: block    # block | redact | log
on_pii_detected: redact       # block | redact | log

allowed_models:
  - claude-sonnet-4-6
  - gpt-4o
  - deepseek-chat

Smart Routing

Route requests based on content, task type, language, or model:

routing:
  sticky_sessions: true      # same conversation → same model
  session_ttl_hours: 24

  rules:
    # PII → never leaves the machine
    - match: contains_pii
      action: route_to
      destination: local_ollama

    # Simple questions → cheap model
    - match: task_type
      task_type: simple_qa
      action: route_to
      destination: deepseek_cheap

    # Chinese prompts → Chinese-optimized model
    - match: language
      language: zh
      action: route_to
      destination: moonshot

    # Downgrade all GPT-4 requests
    - match: model_pattern
      model_pattern: "gpt-4*"
      action: route_to
      destination: gpt_mini

  destinations:
    local_ollama:
      provider: ollama
      model: llama3.2

    deepseek_cheap:
      provider: deepseek
      model: deepseek-chat    # $0.14/M vs $10/M for GPT-4o

    moonshot:
      provider: moonshot
      model: moonshot-v1-8k

    gpt_mini:
      provider: openai
      model: gpt-4o-mini

Supported Providers

Built-in — just set the env var:

Provider Env var Notes
Anthropic ANTHROPIC_API_KEY
OpenAI OPENAI_API_KEY
DeepSeek DEEPSEEK_API_KEY 94% cheaper than GPT-4o
Moonshot MOONSHOT_API_KEY Chinese-optimized
GLM (Zhipu) GLM_API_KEY
MiniMax MINIMAX_API_KEY
Mistral MISTRAL_API_KEY
Azure OpenAI AZURE_OPENAI_API_KEY set base_url in config
Ollama none local models

Add any OpenAI-compatible provider (vLLM, LiteLLM, etc.):

providers:
  my_private_llm:
    base_url: https://llm.internal.company.com/v1
    format: openai
    api_key_env: MY_LLM_API_KEY

CLI Commands

airiskguard-gateway start              # start proxy (foreground)
airiskguard-gateway start --daemon     # start as background daemon
airiskguard-gateway stop               # stop daemon
airiskguard-gateway status             # show status + last hour stats
airiskguard-gateway logs --tail 50     # view audit log
airiskguard-gateway logs --follow      # live log stream
airiskguard-gateway logs --blocked-only
airiskguard-gateway install-cert       # generate CA + install to OS trust store
airiskguard-gateway config init        # write default config.yaml

Team Tier ($299/mo)

The free proxy runs locally. The Team tier adds:

  • Web dashboard with cost breakdown by model
  • Centralized policy server for all developer machines
  • Slack alerts on blocked requests
  • Per-team policies and model allowlists
  • 30-day audit log retention

Start at airiskguard.ai.

License

Proxy core: MIT — free to use, modify, and distribute. Policy server + dashboard (src/airiskguard_gateway/policy_server/): Proprietary — requires a Team license. See airiskguard.ai/pricing.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

airiskguard-0.5.0.tar.gz (44.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

airiskguard-0.5.0-py3-none-any.whl (55.6 kB view details)

Uploaded Python 3

File details

Details for the file airiskguard-0.5.0.tar.gz.

File metadata

  • Download URL: airiskguard-0.5.0.tar.gz
  • Upload date:
  • Size: 44.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for airiskguard-0.5.0.tar.gz
Algorithm Hash digest
SHA256 38d450c5e38ea55976b9228a59c957d5d45f2adc3892e293788622b03df187fa
MD5 90a7255856f9154c0c4478f833ec56ad
BLAKE2b-256 796ac1bdb65ca86d9087d7b051428c161ba3ffa8ed082a0ae040c3fb743d8bf0

See more details on using hashes here.

File details

Details for the file airiskguard-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: airiskguard-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 55.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for airiskguard-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ae1b4594c3d8b35ed9d9a1f091062d401ba393c73f73e13127c3d36390e18685
MD5 aec70527e2ea6782e95f25f80ffbd5ac
BLAKE2b-256 8ab11280893b8d64dbf7f344bdc15aa23ec93ed887fe91fae9fbcf0695635349

See more details on using hashes here.

Release history Release notifications | RSS feed

0.8.0

2 files

0.7.0

2 files

0.6.0

2 files

This release

0.5.0 This release

2 files

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page