aifw

securetron-gh活跃维护

自托管的 AI 网关与推理防火墙,为 Agent 提供身份与访问管理,拦截提示注入并审计调用,防止 LLM 被滥用。

AI Agent Identity and Access Management and Inference Firewall

Alberta发布于 2026-10-21 00:14 UTC438star3fork同步于 2026-11-10 18:00 UTC

怎么上手

由 README 提炼,执行前请确认
docker compose up -d
curl http://localhost:8080/v1/chat/completions -H "Content-Type: application/json" -d '{"model":"gpt-4o","messages":[{"role":"user","content":"Hello!"}]}'
硬件要求按 README 说明

README 未说明硬件要求;以 Docker 镜像方式运行,需搭配 PostgreSQL,未提及 GPU 或显存。

有 Docker 镜像
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

自托管的 AI 防火墙网关,为每个 AI Agent 做身份认证、授权、内容检查和审计

自托管的 AI 网关与推理防火墙,为 Agent 提供身份与访问管理,拦截提示注入并审计调用,防止 LLM 被滥用。

核心能力

  • 对每个 prompt 和响应做扫描、PII 脱敏与语义意图评分
  • 用 A2A 协议、mTLS、OIDC SSO、SCIM 给 Agent 发身份
  • 语义门控的 prompt 压缩与检查门控缓存来省钱
  • 只记元数据的事务日志,可加密导出到 SIEM
  • 覆盖 Claude 推理钩子、Cursor Hooks、MCP 工具治理

容易踩的坑

默认登录是 superadmin / happy,上线前必须改;单独 docker run 不自动建库,连不上 PostgreSQL 会退回内存存储、重启丢数据;网关默认监听 80 和 443,示例 curl 却用 8080,需自行映射端口。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

3 个版本Alberta
  1. AlbertaAIFW v1.5.307 - Alberta, Canada最新正式版2026-10-21 · 2026-10-21 00:14 UTC

    AIFW 1.5.307

    Released: 2026-10-20 Edition: Community and Enterprise Runtime: ASP.NET Core on .NET 11 RC1 (11.0.100-rc.1 SDK, 11.0.0-rc.1 runtime)

    AIFW is the AI governance and agent-trust gateway from Securetron: policy enforcement, prompt and response inspection, routing, identity validation and audit for generative-AI traffic, without locking you to a model provider.

    Container images

    RegistryImageTags
    GitHub Container Registryghcr.io/securetron-gh/aifw1.5.307, latest
    • linux/amd64, runs as non-root user app, HTTP 80 / HTTPS 443 (Endpoints:WebHttps).
    • Image digest: sha256:08532520feb4feebe7a66973b9690863d9dab2101a8b4c909f840ee73e78cb40
    docker run --rm -p 8080:80 \
      -e ConnectionStrings__PostgreSQL="Host=<host>;Port=5432;Database=pki_remote_agent;Username=<user>;Password=<pass>" \
      -e AiFw__JwtSecret="<secret>" \
      -e AiFw__Ledger__Key="<quota-ledger hmac key>" \
      ghcr.io/securetron-gh/aifw:1.5.307
    

    PostgreSQL is required: the container exits during startup when the database is unreachable rather than serving from a fallback store. Health: GET /api/health · A2A discovery: GET /.well-known/agent-card.json

    What's new

    Microsoft Decision-1 as a policy classifier

    Foundry's System One decision model is now a first-class option instead of an add-on:

    • Model Inventory gains a Microsoft Decision-1 (System One decisions, not chat) protocol. Point the backend URL at the resource endpoint and put the deployment name in the model ID; the entry carries its own key.
    • Guardrails → Classifier offers decision alongside the chat and embedding backends. Both the risk stage and the flag verifier use the selected classifier, so picking once is enough.
    • POST /v1/decision lets agents reach a decision model through the gateway: same authentication, same prompt inspection, same masking, same audit row and the same 400 + X-Gateway-Security: Violated refusal shape as every other endpoint.
    • Question mode (semantic_question_mode) controls how the classifier is asked: per_rule asks one question per rule, batched sends every rule's question in a single decision request (per-rule scores kept, prompt billed once), single asks one combined question.

    Measured on the buried-injections corpus (726 cases: 629 attacks, 97 benign; 7 built-in rules):

    ClassifierModeAttacks caughtBenign blockedp50
    deepseek-v4-flashper_rule629/629402990 ms
    gpt-6-lunaper_rule629/629383013 ms
    Microsoft Decision-1per_rule323/62922011 ms
    Microsoft Decision-1batched629/6294274 ms

    The per_rule decision row is a throttling artefact, not a classifier result: one question per rule meant seven calls per request and 393 429 responses, which the fail-open path counted as passes. Batched mode recorded none. On AgentDojo v1.2.2 (949 attacks, 97 benign) Decision-1 in batched mode caught 949/949 with 5 benign blocks at 276 ms.

    Flag verification that cannot hide

    • The flag-verification score is recorded on blocked rows, and verdicts are attached to the exact request that produced them, including asynchronous verification.
    • Blocks are judged by the rule's block threshold rather than its flag threshold, so a confirmation can actually act on the verdict.
    • With verification on, a flagged prompt is refused before the answer is generated, not after.
    • Rules accept configurable exemplars, and the built-in rules ship tuned thresholds.
    • Blocked rows now carry the endpoint kind, so Activity says which endpoint refused.

    Cursor agent hooks and IDE artifacts

    • POST /hooks/cursor records one audit row per shell invocation, with a capture mode and a configurable repeat window for duplicate suppression.
    • The shim answ
  2. GooseAIFW 1.1.245 - The Goose 2026-09-29 · 2026-09-29 05:08 UTC
    查看更新说明

    AIFW 1.1.245

    Released: 2026-09-18 Edition: Community Runtime: ASP.NET Core on .NET 11 RC1 (11.0.0-rc.1.26425.128)

    AIFW is the AI governance and agent-trust gateway from Securetron: policy enforcement, prompt and response inspection, routing, identity validation and audit for generative-AI traffic, without locking you to a model provider.

    Container images

    RegistryImageTags
    GitHub Container Registryghcr.io/securetron-gh/aifw1.1.245, latest
    Docker Hubsecuretron/aifw1.1.245, latest
    Azure Container Registrysecuretronlab.azurecr.io/agenttrust1.1.245, latest
    • linux/amd64.
    • Runs as non-root user app; HTTP 80, HTTPS 443 (Endpoints:WebHttps).
    • Image digest: sha256:fd20b29ba3b35619ff7f721111a5162f6a0b04b99c072df747901f2ff38a9b0e
    docker run --rm -p 8080:80 \
      -e ConnectionStrings__PostgreSQL="Host=<host>;Port=5432;Database=pki_remote_agent;Username=<user>;Password=<pass>" \
      -e AiFw__JwtSecret="<secret>" \
      ghcr.io/securetron-gh/aifw:1.1.245
    

    Health: GET /api/health · A2A discovery: GET /.well-known/agent-card.json

    What's new

    .NET 11 RC1, pinned for reproducible builds

    The stack now targets .NET 11 RC1, with the SDK and container base images pinned to exact versions. A rebuild produces the same runtime rather than following a floating tag:

    • SDK 11.0.100-rc.1.26425.128
    • Microsoft.AspNetCore.OpenApi 11.0.0-rc.1.26425.128
    • Base images mcr.microsoft.com/dotnet/sdk:11.0.100-rc.1 / aspnet:11.0.0-rc.1

    Better behaviour under database pressure

    Transient PostgreSQL conflicts — deadlocks, serialization failures and dropped connections — are now retried instead of surfacing as failed gateway or certificate operations. Database access retries up to 5 times with up to 10 seconds of backoff, so a busy database slows throughput rather than failing requests.

    Usage rollups: bounded and predictable

    The rollup behind organisation-wide reporting (dashboard totals, long-window trends) reads within a bounded window and writes in batches, keeping memory use and write bursts predictable on large installations. Every setting is optional:

    SettingDefaultRange
    AiFw:Rollups:IntervalMinutes605 – 1440
    AiFw:Rollups:Days71 – 90
    AiFw:Rollups:TopEntitiesPerDay2001 – 5000
    AiFw:Rollups:MaxTransactions2,000,0001,000 – 20,000,000
    AiFw:Rollups:Enabledtrueon / off

    Configuration sample

    docker-compose.yml pins its example tag to 1.1.245 and no longer carries a placeholder secret, so a copied sample cannot ship a published value by accident.

    Upgrade notes

    • No database schema changes. Replace the image; existing data and settings continue to work.
    • Configuration is backward compatible. Required settings: ConnectionStrings__PostgreSQL, AiFw__JwtSecret, and upstream model credentials (AiFw__Llm__BackendApiKey or per-model keys). Set ASPNETCORE_ENVIRONMENT=Production for real deployments.
    • Community Edition usage limit: up to 300,000,000 tokens per rolling 30 days (minimum 1,000), with a 7-day grace period when the allowance is exceeded.
    • Without a configured database the gateway falls back to in-memory storage — nothing is retained across restarts, so use PostgreSQL beyond a trial.
  3. AIFWAIFW - True North Edition2026-09-18 · 2026-09-18 04:13 UTC
    查看更新说明

    AI-FW - True North Edition

    AI-FW is the AI firewall and governance gateway. It sits between your AI agents and the models they call, and it identifies, authorizes, inspects, governs and audits that traffic. It runs as a container in your own environment, in front of your existing identity stack.

    Start here

    This release includes

    • The complete knowledge base: guides, tutorials, how-to recipes, API reference and admin reference, also rendered at https://aifw.io/docs
    • A dashboard screenshot asset (AI-FW-Dashboard.png) for internal reviews and briefings

    Editions

    Links

    Support: [email protected]

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    AI-FW

    The AI Firewall & Governance Gateway

    Every AI agent: identified, authorized, inspected, governed.

    Documentation · Website · Get started · Enterprise

    Self-hosted Enterprise ISO 27001 SOC2 Docs PRs welcome

    AI-FW is the AI firewall and governance gateway between your AI agents and the models they call. Every prompt and response is inspected, governed, and routed, with provable agent identity and regulator-ready audit, all in one process that runs in your own environment.

    • Fail-closed by design: offline guardrails never delegate to third parties, no traffic while scanning is unhealthy
    • Agents are identities: A2A protocol, agent registry, mTLS, Kerberos, OIDC SSO, SCIM provisioning
    • Cost savings without safety holes: semantic-gated prompt compression and inspection-gated caching
    • Audit you can hand to a regulator: metadata-only transaction log with encrypted export to your SIEM
    • Surfaces others cannot reach: Claude inference hooks, Cursor Agent Hooks, MCP tool governance, M365 Copilot admin with agent sync
    • Opt-in endpoint gateway: images, audio, files, fine-tuning, and batches under the same inspection pipeline

    🛡️ Features

    Every feature is documented on aifw.io/docs and in this repository's docs/ folder. Product updates and practical guidance are published on AI-FW Insights, with an RSS feed.

    Legend: ✅ native · 🧩 via partner or plugin · ❌ not supported

    CategoryFeatureDocNative
    Security & guardrailsPrompt & response guardrailsRead✅
    Security & guardrailsSemantic intent analysisRead✅
    Security & guardrailsFail-open options (opt-in)Read✅
    Security & guardrailsClaude inference hooksRead✅
    Identity & agentsIdentity & access (IDAM)Read✅
    Identity & agentsAdmin-issued API keysRead✅
    Identity & agentsA2A agent protocolRead✅
    Identity & agentsChain of CommandRead✅
    Identity & agentsAgent self-enrollmentRead✅
    CostCompletion cacheRead✅
    CostPrompt compressionRead✅
    Observability & auditObservability & dashboardRead✅
    Observability & auditRisk profiles & auto-blockRead✅
    Observability & auditAudit logs & exportRead✅
    Governance & complianceCompliance module administrationRead✅
    Governance & complianceSkills & Tools governanceRead✅
    Governance & complianceIDE ArtifactsRead✅
    Governance & complianceConfiguration backup and restoreRead✅
    IntegrationsM365 Copilot adminRead✅
    IntegrationsClaude Code, Cursor & MCPRead✅
    IntegrationsCursor Agent Hooks and shimsRead✅
    Integrationssecuretron-aifw hook packageUse the package✅
    IntegrationsEndpoint gatewayRead✅
    Core & referenceModel routing & registryRead✅
    Core & referenceReliabilityRead✅
    Core & referenceAdvanced parametersRead✅
    Core & referencePrompt AnalyzerRead✅
    Core & referenceAdmin pagesRead✅
    Core & referenceSupported models & endpoints (200+)Read✅
    InsightsAI-FW InsightsRead✅

    OpenAI Anthropic Google Meta xAI DeepSeek Mistral Groq Azure AWS Alibaba Ollama

    [!WARNING] Model IDs change frequently. Always verify against each vendor's live model list before registering a model (see the models reference).

    ⚡ Quick start

    1. Run the gateway and its database

    docker compose up -d
    

    The docker-compose.yml in this repository starts the gateway alongside PostgreSQL: both share a network, the database runs on a named volume so data survives restarts, and the gateway waits for it to report healthy before starting. One command, no manual setup.

    The default login is superadmin / happy.

    [!NOTE] The gateway listens on 80 (HTTP) and 443 (HTTPS). Pin a published version with AIFW_TAG=1.1.245 docker compose up -d.

    The image can be started on its own, but it does not provision a database, so you must supply a reachable PostgreSQL:

    docker run -d --name aifw-gateway -p 8080:80 \
      -e "ConnectionStrings__PostgreSQL=Host=your-postgres;Port=5432;Database=aifw;Username=...;Password=..." \
      ghcr.io/securetron-gh/aifw:latest
    

    [!IMPORTANT] Without a reachable PostgreSQL the gateway still starts, but it falls back to in-memory stores and all data is lost on restart. The built-in default connection string points at localhost, which inside the container is the container itself, so a sibling database container must be addressed by its name on a shared Docker network.

    The same image is published to Docker Hub as securetron/aifw.

    2. Make your first request

    curl http://localhost:8080/v1/chat/completions \
      -H "Content-Type: application/json" \
      -d '{"model":"gpt-4o","messages":[{"role":"user","content":"Hello!"}]}'
    

    Open the gateway at http://localhost:8080 and watch the transaction appear in the dashboard.

    [!TIP] To route traffic through the gateway, register these backend URLs and models in the AI-FW Model Inventory (see Configure models and keys).

    🔄 How it works

    flowchart LR
      A["Client / Agent"] --> B["AI-FW Gateway"]
      B --> C["Inspect<br/>prompt scan, PII mask"]
      C --> D["Govern<br/>rules, semantic tier"]
      D --> E["Route<br/>registry, resilience"]
      E --> F["LLM Backend"]
      F --> G["Audit<br/>metadata-only log"]
      G --> A
    
    1. Connect - point any OpenAI-compatible or Anthropic client at the gateway (SDKs, Claude Code, Cursor, MCP tools, or plain HTTP)
    2. Inspect - every prompt and response is scanned, PII-masked, and semantically scored
    3. Govern - routing rules, risk profiles, and policy decide what flows and what is blocked
    4. Audit - metadata-only logs and events record exactly what happened

    📚 Documentation

    This repository holds the AI-FW knowledge base. The rendered version lives at aifw.io/docs.

    flowchart TD
      A["docs/"] --> B["getting-started/"]
      A --> C["guides/"]
      A --> D["tutorials/"]
      A --> E["how-to/"]
      A --> F["api-reference/"]
      A --> G["admin/"]
      A --> H["community-edition/"]
      B --> B1["what is AI-FW, quick start"]
      C --> C1["guardrails, routing, semantic, identity, risk, reliability, compression, hooks, observability, audit, API keys"]
      D --> D1["OpenAI SDK, Claude Code & MCP, M365, agent enrollment"]
      E --> E1["models & keys, AI-assisted rules, Azure"]
      F --> F1["OpenAI-compatible, Anthropic Messages, A2A, endpoints, current model catalog"]
      G --> G1["settings, inventory, rules, risk, audit, dashboard, M365, users, keys, agents, CA, trust, compliance"]
      H --> H1["license & monthly token allowance"]
    
    SectionTopicsFiles
    Getting StartedWhat AI-FW is, quick startdocs/getting-started/
    GuidesGuardrails, routing, semantic analysis, identity, risk, reliability, compression, hooks, observability, audit, API keys, Chain of Command, Cursor Agent Hooksdocs/guides/
    TutorialsOpenAI SDK, Claude Code & MCP, M365 Copilot admin, agent self-enrollmentdocs/tutorials/
    How-ToModels & keys, AI-assisted rules, Azure deploymentdocs/how-to/
    API ReferenceOpenAI-compatible, Anthropic Messages, A2A agent protocoldocs/api-reference/
    Admin ReferenceSettings, Model Inventory, Rules Manager, Risk Profiles, Audit, M365, Users, Agents, CA, Agent Trust, Compliance, Skills & Tools, IDE Artifacts, Backup & Restoredocs/admin/
    Community EditionLicense & monthly token allowancedocs/community-edition/

    🧩 Enterprise

    • ✅ ISO 27001 certified and SOC2 compliant
    • ✅ Fail-closed by design - no traffic while scanning is unhealthy
    • ✅ App-only Microsoft 365 Copilot integration with agent sync
    • ✅ Role-based access control, OIDC SSO, and SCIM provisioning
    • ✅ Encrypted audit export to your SIEM (syslog over TLS)
    • ✅ Self-hosted in your environment with no per-token fees

    Book a demo or get started.

    🔒 Security

    To report a security issue, contact us at aifw.io/contact.

    🤝 Contributing

    PRs are welcome.

    We would also like to thank the Securetron.net team for their continued support in helping the community.