Skip to main content

System Administration (CLI)

On a self-hosted deployment you own the system-wide operational settings, and you can change them live, without asking us to redeploy. You administer these with the DocAI Fabric CLI, which you install straight from your own running deployment so it always matches your version.

This page covers the one-time setup: installing the CLI, pointing it at your deployment, and optionally enabling an AI agent to drive it. Once that is done, each individual task has its own short guide, starting with Configure SMTP.

Who can do this​

System settings are system-wide, not tenant settings. They are reachable only with your deployment's admin API key (ADMIN_API_KEY). No regular user, not even a tenant administrator, can see or change them. Keep the admin key safe.

How you obtain this key depends on how your deployment is run:

  • Managed in Azure by the DocAI Fabric team: we provision the admin key as part of your deployment and share it with you securely during onboarding.
  • Self-hosted on-premises: you create ADMIN_API_KEY yourself when you deploy (it is one of your deployment environment variables), so you already hold it.

Administrator keys​

Preview

Administrator keys are in Preview: ready to use, and they may still change based on feedback.

Start with the admin key. It does everything on this page, in the CLI and through an AI agent, and a deployment with one administrator needs nothing else. Administrator keys are optional: issue them when several agents or people look after the deployment and each should open only its part. An agent always works with the one key it was given, and when that key does not open something, the answer says which scope or key it needs.

To give an AI agent, a script or a colleague only part of the administration, issue them an administrator key with the admin key. Each one has one or more scopes:

ScopeOpensPeople's data
systemSystem settings (except the Security group), models, tenants (create, list, delete, set their limits), migrations, retention policyNone. A tenant's owner shows as a user id; the mail sender and username show only as set or not set
securityThe security audit log, its retention, forwarding and purge, sign-in blocks, the Security settings group, and the tenants list with each owner's emailYes
tenant_accessThe ways into a tenant: support keys (below), the deployment's single sign-on, and the tenants list for their idsA support key opens the tenant's data; single sign-on mappings decide who signs in to which tenant, and as what
da admin keys create --name "Monitoring agent" --scope system --read-only --expires-in-days 90
da admin keys list
da admin keys revoke <key-id>
  • --read-only lets a system or security key read but not change anything, and lets a tenant_access key open support keys with read permissions only.
  • A key always expires, within a year, and is shown once. Store it as a secret.
  • Deleting a tenant on a self-hosted deployment needs system and security together, because its audit log is exported first.
  • Only the admin key issues, lists and revokes administrator keys. A revoked key stops on its next request.
  • Every issue and revocation, and every request a key's scopes do not open, is in the security audit log under the key's name. So is everything a key does.

A system key is the one to give an AI agent that looks after models and settings: what it reads names no person.

Support keys​

As the administrator you run the deployment, not the tenants in it. To work inside a tenant, for a support request or to fix its configuration, open it with a support key, which the tenant sees:

da admin tenant support-key open <tenant-id> --reason "Request 42: exports fail"
da admin tenant support-key list <tenant-id>
da admin tenant support-key close <tenant-id> <key-id>
  • It is an API key on that tenant with the permissions you choose: --grants read_only (the default), another preset such as configure, or permission ids separated by commas, and --projects to limit it to some projects. It cannot manage API keys or single sign-on, so it never leaves a way in behind it.
  • It stops after 4 hours (--hours, at most 168) and is shown once.
  • The tenant's administrators get an email with your reason, see the key with a Support badge on their Agents & API page, where they can revoke it, and find its opening and closing in their security audit log.
  • list shows the tenant's support keys only, never its other keys.

Step 1: Install the CLI from your deployment​

The CLI is served by your deployment, so the version always matches the running system.

One line:

curl -fsSL https://app.docaifabric.com/cli/install.sh | sh

This installs two equivalent commands: docaifabric and the short alias da. Check it:

da --help

Prefer pip yourself? Ask the deployment for the exact install command (it includes the current version), then run it:

curl -s https://app.docaifabric.com/cli/info
# use the "install_command" value it returns, for example:
# pip install https://app.docaifabric.com/cli/download/docaifabric_cli-1.3.0-py3-none-any.whl

Step 2: Point the CLI at your deployment​

The CLI needs your deployment URL and admin key. Set them as environment variables:

export DOCAIFABRIC_API_URL="https://app.docaifabric.com"
export DOCAIFABRIC_ADMIN_API_KEY="your-admin-api-key"

Or put them in a .env.cli file in your working directory:

DOCAIFABRIC_API_URL=https://app.docaifabric.com
DOCAIFABRIC_ADMIN_API_KEY=your-admin-api-key

Step 3: Let your AI agent do it (optional)​

An AI agent that runs commands on your computer, such as Claude Code or Codex, can drive these commands for you. Tell it your deployment's address, for example "administer our DocAI Fabric at https://app.docaifabric.com". It reads https://app.docaifabric.com/llms.txt, which tells it to install this CLI and read the playbook the deployment serves for its version:

da skill show system-administration

You can then simply ask, for example, "configure SMTP for this deployment" or "why are invitation emails not sending". Keep the admin key in the environment variables above: the agent never needs to see it, and the playbook tells it never to put a secret on the command line.

Over MCP​

An agent can also administer the deployment as an MCP server, without a shell: the admin MCP server at https://app.docaifabric.com/mcp/admin covers system settings, tenants and their limits, support keys, single sign-on, models, the audit log, and listing and revoking administrator keys. It accepts the admin key or an administrator key, which it reads from your environment, and offers only the tools that key's scopes open:

# Claude Code
claude mcp add --scope user --transport http docaifabric-admin https://app.docaifabric.com/mcp/admin \
--header "X-API-Key: $DOCAIFABRIC_ADMIN_API_KEY"
# OpenAI Codex: ~/.codex/config.toml
[mcp_servers.docaifabric-admin]
url = "https://app.docaifabric.com/mcp/admin"
bearer_token_env_var = "DOCAIFABRIC_ADMIN_API_KEY"
tool_timeout_sec = 600 # a model test can take minutes

It is a separate server from the one your users connect to at /mcp, which works inside one tenant and never accepts the admin key. These rules hold on it:

  • Secrets never pass through it. The agent cannot set the SMTP password or a single sign-on client secret, and never sees a one-time password: it tells you the da admin command to run, which asks for the value with the input hidden.
  • Deletions wait for you. Deleting a tenant, a single sign-on connection or a domain, or purging the audit log, first returns what would be deleted (for a tenant, only once you have exported its whole audit log, which is deleted with it), and happens only when the agent confirms it with the token it got, which it is told to do only with your agreement.
  • So do changes to where data goes. Pointing email at another SMTP server (or changing its port, account, sender address or encryption), changing the application URL, the operator notification address or audit forwarding, adding a model or giving one an endpoint at a new URL first returns what would change and what would go there, and happens only when the agent confirms it through the execute_write_destructive tool. Keep that tool on "ask" in your agent's permissions: your client's own prompt is where you agree. The agent makes every other change itself.
  • So does a support key. Opening a tenant with one always returns what the key would open first, and happens only when the agent confirms it through execute_write_destructive.
  • Every change is recorded in the security audit log, as a call made with the admin key or the administrator key's name, with your agent's address.

Three jobs stay with the CLI: issuing an administrator key, which is shown once and so never passes through an agent; exporting the audit log, which writes a file on your machine (the agent can read the same records); and the migrations after an update. Reading the audit log through the agent sends the records it reads to the agent's model provider, as any tool result does.

What you can administer​

Each operation has its own short guide:

  • Configure SMTP - outbound email for invitations and password resets.
  • Configure the application URL - the public address used in the links inside those emails.
  • Tenants and sign-up - create, list and delete tenants, set their limits, and control whether the public can create their own.
  • Configure the system models - add, change and remove the language models every tenant uses, and choose the default model per task.
  • Test and measure models - check that the platform's models (or a tenant's) can do their work, and measure their speed and capacity.
  • Audit log and retention - read the deployment's own security audit stream, forward it to your SIEM, set how long every tenant's audit log is kept, set the operator notification address, and clear a sign-in block.
  • Set up single sign-on - connect the deployment to your organization's identity provider (OpenID Connect, for example Microsoft Entra ID or Okta), so people sign in with it in every tenant, and map the provider's groups to each tenant's user groups. A tenant's administrators can also set up their own connection on the Security page.
  • Step settings conversion: the application converts every project by itself after an update; da admin migrations status lists the projects and published versions whose step settings have moved onto their workflow's steps and says why any has not. See Getting updates.
  • Encryption key rotation: the application re-encrypts saved secrets under a new CREDENTIAL_ENCRYPTION_KEY when it starts; da admin credentials status shows whether anything still needs the previous key. See Rotating the encryption key.

Set them up in that order. The links in your emails depend on the application URL, and creating a tenant sends an email, so a working mail setup comes first.

More operations will be added here over time.

Logs are not part of the CLI: you read them with the tools your platform already gives you. See Application Logs for an Azure subscription, or Application Logs (On-Premises) for a Docker install.

Feature flags​

Some features can be switched on or off for the whole deployment, for one tenant, or for one project. The most specific setting applies, and an off for the deployment marked --force overrides every tenant and project.

da admin features list
da admin features set long_document_extraction --off --tenant <tenant-id>
da admin features set long_document_extraction --off --tenant <tenant-id> --project <project-id>
da admin features set long_document_extraction --off --deployment --force
da admin features unset long_document_extraction --tenant <tenant-id>
Preview

Long document extraction is in Preview: ready to use, and it may still change based on feedback.

  • long_document_extraction, on unless you switch it off: Extract reads a document whose class has a table, or of more than 20 pages, in parts of five pages, so that every page and every row is read, and leaves what it could not settle for review. Which documents it reads this way, what it costs, how long it takes and what a reviewer sees: Long Documents. Off, Extract reads a document in one call, as before.
  • embedded_review, on unless you switch it off, for the deployment or an organization: review links, which an integration key makes so that a person without an account reviews one transaction in a frame of the organization's own product (Embedded Review). Off, no link is made and every link stops working within 30 seconds; a step's setting and a key's permission are kept for when it is switched back on.

Embedded review sites​

A partner's product can show the review screen of one transaction in a frame (Embedded Review). Two lists decide which sites may: the deployment's, for every organization, and each organization's own, which someone with Manage tenant edits in Organization Settings. A site on an organization's list opens only that organization's transactions. Organizations' own lists are on from the release that brought them.

da admin embed show # the deployment's sites; whether organizations' lists count
da admin embed add https://portal.example.com # every organization's review screen, from that site
da admin embed remove https://portal.example.com
da admin embed tenant-sites --off # organizations' lists stop counting; they are kept, read-only
da admin embed tenant-sites --on
  • A site is https://host or https://host:port, with no path or wildcard, the host in ASCII. http:// only for localhost, 127.0.0.1, or a deployment served over plain HTTP.
  • Until the first change, the deployment's list is the one in the ALLOWED_EMBED_ORIGINS environment variable; the first change stores it, and the variable is then no longer read.
  • EMBED_TENANT_SITES=off in the application's environment turns organizations' own lists off whatever tenant-sites says, from the next restart: for a deployment whose admin API you cannot reach.
  • A change reaches every replica within 30 seconds. It needs the system scope (a read-only key only shows), and is in the audit log as config.embed_sites.updated.

Troubleshooting the CLI​

  • 401 or 403: your admin key is missing or wrong. Check DOCAIFABRIC_ADMIN_API_KEY matches the deployment's ADMIN_API_KEY. With an administrator key, a 403 names the scope the request needs.
  • Connection refused or timeout: check DOCAIFABRIC_API_URL points at your running deployment and is reachable from where you run the CLI.
  • 404 on an admin route: your deployment predates this feature. Update to a build that includes the system administration API.

For problems specific to a task (for example SMTP), see that task's own guide.