Ankra ai gateway

From ankraio/ankra-cli · View interactive version

Ankra ai gateway is an AI agent skill from the GitHub repository ankraio/ankra-cli. Configure Ankra's AI Gateway across Slack, Microsoft Teams, GitHub, GitLab, and Bitbucket - per-connection Ask/Agent safety modes, the AI code review on every pull request (per-repository rules, related repositories, review model, `@ankraai` mentions), the org staging cluster for ephemeral AI worksp

How to use this skill

Skill file

Ankra AI Gateway

Recommended path

pull requests) and 5 (agent-driven work); see ankra-platform-principles.

--review --mentions`), keep every connection in Ask, and promote one connection to Agent

only where you want fix pull requests opened for you.

through is ankra-cicd; agent governance and model choice are ankra-ai-agents.

automatic review to change code.

The Ankra AI Gateway lets Ankra AI answer and act from **Slack, Microsoft Teams, GitHub, GitLab,

and Bitbucket Cloud. Connections are made under AI → Settings → Connections**, and

connecting one is an organisation admin action.

Safety modes

Every connection carries an AI mode, separate from its capability switches: the switches decide

whether the AI answers, the mode decides how far the answer may go.

| Mode | What the AI can do |

|------|--------------------|

| Ask (default) | Investigate and explain, plus a curated set of safe creations that cannot damage existing infrastructure: an ephemeral workspace pod to clone and search an application's repositories, a throwaway PR demo on the staging cluster, and a brand-new stack. It never modifies existing infrastructure and never opens a pull request. |

| Agent (marked Can act) | Everything Ask allows, plus acting. It opens fix pull requests on its own - the pull request is the review gate. Other destructive changes still ask for confirmation. |

Ask is the default and the gateway fails closed to it: a connection with no explicit mode

inherits the organisation default, which is ask until an admin changes it. Mode is enforced at

the tool offer, the dispatch guard and the executor, so a stale offer or a prompt-injected

instruction cannot escalate. Automatic review events stay read-only whatever the mode.

On GitLab and Bitbucket Cloud, Ankra cannot open the pull request itself, so an Agent-mode reply

proposes the fix with a branch name and commit message instead.

ankra chat --mode ask|agent picks the same modes for a CLI conversation, and MCP token scopes

mirror them (mcp:read is the Ask surface, mcp:write the Agent surface; see ankra-security).

AI code review on every pull request

Nothing runs until it is switched on. A new source-control connection has every capability

off: no review, no mention replies, no previews. Turn them on per connection (the default row) in

the portal, or per repository from the CLI:

ankra org ai-review repos list                         # connections, their defaults and repository rules
ankra org ai-review repos list --reachable             # also what each GitHub App installation can see
ankra org ai-review repos set my-org/api --review --mentions --max-reviews-per-pr 5
ankra org ai-review repos set my-org/api --review-drafts=false --model think
ankra org ai-review repos set my-org/web --previews     # PR preview environments (GitHub only)
ankra org ai-review repos unset my-org/api             # follow the connection defaults again

ankra org ai-review related-repos add my-org/web my-org/api   # reviews of either read the other
ankra org ai-review related-repos list
ankra ai lanes set pr_review think                     # organisation-wide review model
ankra application pull-request-reviews <application-id>  # what the review posted

--review-drafts, --max-reviews-per-pr; =false turns one off); pass

--binding <provider>/<id> when the connection is ambiguous. set and unset need organisation

admin.

pick it with --credential <github-credential> when the organisation has more than one.

related-repos remove takes the pair or the relationship id. Applications on the same cluster

are related with no configuration.

good, no findings, comments, changes requested`) and at most eight findings pinned to their

lines. It also reads callers in the same repository and related repositories for code the change

can break.

always runs, even on a draft or past the per-pull-request cap.

branch, budget reached). Two budgets apply: Auto reviews / PR (default 3) on the repository

rule, and Max runs per day under the application's AI settings.

ankra application ai-config, keyed by repository.

Staging cluster, workspaces and PR demos

Ephemeral AI work runs on one staging cluster the organisation nominates (portal: AI →

Settings → Workspaces), with a workspace lifetime (default 8h), a demo lifetime (default

24h) and the default gateway mode. It must belong to the organisation and have an online agent.

Without it, the safe-creation tools answer "configure a staging cluster first". Expired workspaces

and demos are reaped automatically, and the portal lists what is running so you can stop it early.

that shallow-clones an application's repository to search and read it.

cluster, with a public https URL for reviewers.

Where demos are published:

ankra org ai-environment get
ankra org ai-environment set --demo-base-domain previews.example.com   # a wildcard zone you point at the staging cluster
ankra org ai-environment set --demo-cert-issuer letsencrypt-prod       # only alongside a base domain
ankra org ai-environment set --demo-base-domain ""                     # back to the staging cluster's Ankra subzone

The preview domain is not the organisation's root domain (ankra org domain). A write that leaves

previews on plain http says so. In Terraform, ankra_ai_environment manages the staging cluster,

lifetimes, default gateway mode and preview domain together.

Failed builds and fix pull requests

On Ankra Pipelines, a failed build on an application's tracked branch dispatches an agent. The

application's CI/CD AI lane decides how far it goes:

| Lane | What happens |

|------|--------------|

| Ask (default) | It investigates and proposes a fix, without committing |

| Agent | It commits the fix on a new branch and opens a pull request for you to review |

A failed run on someone's own pull request is never committed to: the pull request gets the

explanation and a Fix with Ankra link on the run page instead.

From an Agent-mode Slack workspace or Teams tenant, *"fix the failing build in

owner/repo"* works the same way: Ankra investigates, opens the pull request, and replies in the

thread with the link. It never pushes to the default branch, never force-pushes and never merges.

From an Ask-mode connection it stops at the proposed patch and says to switch to Agent.

Rules

at ask.

https preview domain, never a port-forward.

person reviews and merges them.

Related skills

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.