Gnt

io.github.gnt-ai由 GitHub 账号 gnt-ai 发布v0.6.0更新于 Nov 2, 2026

Git-native policy layer for AI agents: check_action verdicts against rules approved via PR.

已验证Streamable HTTP可网页运行知识与记忆开发者工具安全与监控

概览

AI 生成的概览

Git 原生的策略层:让助手在执行动作前对照团队经 PR 批准的规则检查,得到允许、阻止或需人工处理的裁决。

可以做什么
  • 对照已批准规则检查描述的动作,返回 allowed、blocked 或 needs_human 裁决,并附引用规则与一句理由
  • 按语义搜索已批准规则,可按标签过滤
  • 按 id 获取单条已批准规则及其来源信息(批准人、时间、引用来源)
  • 列出组织的已编译技能包版本,并获取某个包的清单与文件列表
适用场景
当智能体要执行退款、删除、给客户发消息等有后果的动作,且希望每次都由团队通过合并 PR 批准的规则把关并留下可追溯记录时使用。
运行要求
远程 MCP 端点 api.gntai.dev。配套 CLI 需 Node 22.13 或更高版本,需通过 gnt login 登录并在本地保存 API 密钥,并连接一个 GitHub 仓库存放规则。可选变量 GNT_API_URL、GNT_WEB_URL、GNT_CONFIG_DIR 用于更改端点和配置目录。
安装前请注意
规则同时存放在所连接的 GitHub 仓库和 gnt 自己的数据库中,MCP 工具读取的是该存储而非每次克隆仓库。默认规则提取会把源文本发送给 Anthropic 的 API,提取出的规则文本会发送到 gnt 的 API 以创建 PR。CLI 会把 API 密钥保存在 credentials.json 中。裁决默认失败即关闭为 needs_human,未被规则覆盖的动作不会被自动放行。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Gnt,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/io.github.gnt-ai%2Fgnt/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。

{
  "mcpServers": {
    "gnt": {
      "type": "http",
      "url": "https://api.gntai.dev/mcp"
    }
  }
}

README

Run the setup below once and every agent your team runs has a git-native rulebook it has to check over MCP before it acts, approved the same way your code already is: a merged pull request.

  • Rules live in your repo as files and ship through normal PRs, not a dashboard click.
  • Agents call check_action over MCP before anything risky (a refund, a delete, a message to a customer) and get back an allow/block/escalate verdict.
  • Every rule traces back to the git file and the PR that approved it, so "why did the agent do that" always has a paper trail.

Prefer not to run any of this yourself? The hosted version at gntai.dev does the same thing without you standing up a Postgres instance.

Get started (30 seconds)

bash
npm install -g @gnt-ai/clignt logingnt connect githubgnt prebrain# merge the opened PR on GitHub. that merge is the approval

Try it with Docker first

To see a real check_action response before installing Node or npm, clone the repository and run the Docker-only demo:

bash
./demo.sh

It builds the full local stack in an isolated gnt-demo Compose project, seeds an approved refund rule, calls check_action, and prints a curl command you can run again. Without an Anthropic key the real fail-closed path returns needs_human; pass GNT_DEMO_ANTHROPIC_API_KEY=sk-ant-... ./demo.sh to opt in to the model's grounded policy verdict. The demo uses deterministic local embeddings and throwaway localhost-only secrets, so it does not need a ZeroEntropy key.

[gnt connect's interactive picker, and what gnt prebrain's draft-PR output looks like]

Nothing for gnt prebrain to scan yet? Run gnt init first — it scaffolds rules/ locally with a couple of example rule files so there's something real to look at and edit, and points you at gnt prebrain --starter-packs for a curated pack to start from instead.

That merge lands a rule file in your connected repo, shaped like this:

your-repo/└── rules/    ├── refund-approval-threshold.md    └── contract-legal-cc.md

Each file is plain markdown with YAML frontmatter:

markdown
---title: Never refund over $500 without a managerstatus: approvedconfidence: 0.91owner_id: finance-teamsource_citations: [...]source: slacktags: [refunds, finance]last_validated_at: 2026-07-20version: 1superseded_by: nullapproved_by: [email protected]approved_at: 2026-07-21T14:03:00Zcreated_at: 2026-07-18T09:12:00Zpr_number: 142pr_url: https://github.com/your-org/your-repo/pull/142---
Refunds over $500 need manager sign-off before they go out...

See it in action

There's no captured transcript to show yet (see the gap noted at the bottom of this README). Here's the actual response shape a check_action call returns, straight from the tool's contract:

json
{  "verdict": "blocked",  "reason": "Refund exceeds the $500 threshold without manager sign-off (rules/refund-approval-threshold.md)",  "cited_rules": [    { "id": "refund-approval-threshold", "title": "Never refund over $500 without a manager" }  ],  "rules_retrieved": 3}

verdict is one of allowed, blocked, or needs_human. needs_human is the fail-closed default: no approved rule covers the action, retrieval failed, or the check couldn't complete. It never guesses.

What it does

One MCP endpoint, five tools:

ToolWhat it does
check_actionChecks a described action against your approved rules before an agent takes it. Returns allowed, blocked, or needs_human with cited rules and a one-line reason.
search_rulesSemantic search over your org's approved rules, optionally filtered by tag. An empty list means no approved rule covers the query.
get_ruleFetches one approved rule by id, with its provenance (who approved it, when, what it was cited from).
list_skill_packsLists every compiled skill pack version for your org, newest first.
get_skill_packFetches a compiled skill pack's manifest and file list by id.

Prerequisites

RequirementCheckGet it
Node >=22.13node --versionnodejs.org

Install

MethodCommand
curlcurl -fsSL gntai.dev/install.sh | sh
npmnpm install -g @gnt-ai/cli

gnt needs Node >=22.13. If the CLI fails to start with a version error, update Node first and confirm with node --version.

Common commands

bash
gnt login                # sign in, store an API key locallygnt init                 # scaffold a local rules/ dir with example rule filesgnt connect github       # connect the repo your rules PRs open againstgnt prebrain             # scan sources, extract candidate rules, open PRsgnt review               # review rules awaiting approvalgnt status               # show brain statusgnt pull                 # download the latest skill packgnt gaps                 # list uncovered queries with no approved rule

Config

VariableDefaultWhat it controls
GNT_API_URLhttps://api.gntai.devAPI endpoint the CLI and MCP calls hit
GNT_WEB_URLhttps://gntai.devWeb app used for gnt login's browser step
GNT_CONFIG_DIR~/.gntWhere credentials.json and local config live

Privacy

  • No analytics or telemetry dependency in the CLI or the web app.
  • gnt prebrain's default extraction mode is cloud, not on-device: your source text goes straight to Anthropic's API (or Vercel AI Gateway with zero-data-retention, if you configure it), never to gnt's own servers. Fully on-device extraction needs --mode local against a local Ollama daemon.
  • The extracted rule candidates still get sent to gnt's API to open the PR. Raw source text stays off gnt's servers in cloud mode; the resulting rule text doesn't.
  • Rules live in your connected GitHub repo and in gnt's own database. The MCP tools read from gnt's store, not by cloning your repo on every call.
  • Self-hosting: apps/api only sends error data to Sentry if you set SENTRY_DSN yourself. Leave it unset and nothing goes out.

Team setup

  • Who writes rules: anyone with access to your connected repo, either through gnt prebrain (batch-extracted from real sources) or gnt review (hand-proposed).
  • How approval works: merging the PR is the approval. There's no separate publish step.
  • What gets committed: rules/<rule-id>.md files with the frontmatter shown above and a plain markdown body.
  • Catching a malformed rule before it's reviewed: gnt rules lint checks a rule file's frontmatter locally, and gnt-ai/gnt/.github/actions/lint-rules runs the same check as a CI step on your rules repo's own PRs, so a bad frontmatter fails the PR instead of the review.

Troubleshooting

Self-hosting: gnt login's browser step has nowhere to land. gnt login opens a browser to a /cli-login page and polls the API for the resulting key — that page is served by the hosted product's web app, which isn't part of this repo. There's no CLI-only login flow (device code or otherwise) today, and no gnt command to set a key manually. Self-hosting this stack currently means building your own thin frontend for that one route (it just needs to complete the sign-in flow and hand the CLI a key). This is a real, open gap in the self-host path, not a config issue — closing it properly means adding a CLI-only login flow.

ValueError: refusing to start: these settings still have their .env.example placeholder value... A change-me-... string is still sitting in apps/api/.env. The error names every offending field; generate a real value for each and retry.

store fails to start with GNT_STORE_INTERNAL_API_SECRET is not set. apps/store/.env wasn't filled in, or wasn't picked up. Confirm the file exists at that exact path, not still named .env.example.

Every store-to-api call gets rejected with 401 or 403, even though both services are up. STORE_INTERNAL_API_SECRET / APPROVAL_SIGNING_SECRET in apps/api/.env don't byte-for-byte match GNT_STORE_INTERNAL_API_SECRET / GNT_APPROVAL_SIGNING_SECRET in apps/store/.env. This fails closed by design. Regenerate both pairs so the two files agree.

A rule fails to save with an embedding or rerank error. apps/store/.env is missing ZEROENTROPY_API_KEY, or it's still empty. Get a real one from zeroentropy.dev.

Full command reference

gnt logingnt logoutgnt init                 scaffold a local rules/ dir with example rule files (--dir <path>)gnt connect <app>        github, slack, notion-mcp, monday-mcp, linear-mcp, jira-mcp,                          sentry-mcp, granola-mcp, zoom-mcp, figma, datadog,                          gitlab-threads, hubspot, airtable, openclaw, hermesgnt disconnect <app>gnt statusgnt billinggnt reviewgnt pullgnt gapsgnt prebrain              scan local sources, extract candidate rules, open batched draft                           PRs (~60 flags for source paths and extraction mode, see                           `gnt prebrain --help`; --mode cloud|local, cloud is the default)gnt stalegnt keys list|create|revoke|rotategnt webhook list|create|revokegnt org show|rename|invite|remove

Shell completion

bash
# bash, add to ~/.bashrceval "$(gnt completion bash)"
# zsh, add to ~/.zshrceval "$(gnt completion zsh)"
# fish, add to ~/.config/fish/config.fishgnt completion fish | source

Learn more

Self-hosting is a first-class, fully supported path — Apache-2.0 from day one, run it on your own infra with your own keys, or use the hosted version at gntai.dev. The homepage FAQ and the self-hosting docs both describe this same path; there is no "not today" caveat.

License

Copyright © 2026 gnt.ai. Licensed under Apache-2.0 — see LICENSE for the terms and NOTICE for the trademark rule on forks.

Why is this free?

Self-hosting gnt costs you nothing, forever — clone it, run docker compose up, bring your own keys. What we sell is the part self-hosting doesn't give you: hosting at gntai.dev, managed OAuth connectors (GitHub, Slack, Linear, Notion, Zendesk — no app-approval process on your end), and usage-based AI features. If you'd rather run it yourself, that's a fully supported, fully free path, not a crippled trial of the real thing.

Contributing

See CONTRIBUTING.md for dev setup and how to open a PR. Every commit needs a Signed-off-by trailer (git commit -s), the Developer Certificate of Origin instead of a CLA. No separate form, just the flag.

Thanks to everyone who's sent a PR:

[gnt contributors]

来源:README.md,提交 59a743d

工具

0
SourceWeft 尚未读取此服务器的工具。

版本历史

1
  1. v0.6.0最新Sep 16, 2026

评分

已满足适用检查项的 85%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具必需15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分