The Admin Companion client needs to be able to send POST requests to and receive answers from these two Admin Companion API endpoints:
https://api.admin-companion.ai:443/dialogue/*https://api.admin-companion.ai:443/search/*Make sure your firewalls do not block this traffic.
Simplified network flow:
ADMIN_COMPANION_KEY
to the API key value:export ADMIN_COMPANION_KEY="<Your API key>"$HOME/.bashrc
for bash. Use your own shell's resource file.source $HOME/.bashrc
after changing the file.echo $ADMIN_COMPANION_KEY
in your shell. It should return the API key value.
$HOME/.admin-companion/api-key
(user specific)
ADMIN_COMPANION_KEY="<Your API key>"$HOME/.admin-companion/api-keychmod 600 $HOME/.admin-companion/api-key.
/etc/admin-companion/api-key
(system wide)
ADMIN_COMPANION_KEY="<Your API key>"/etc/admin-companion/api-keychown root:root /etc/admin-companion/api-keychmod 644 /etc/admin-companion/api-keyai "Are you there?"ai "¿Estás ahí?"ai "Est-ce que tu es là?"ai "Bist du da?"$HOME/.admin-companion/admin-companion.log
for details.
The client software has a built-in security layer, which ensures, that only user-approved commands can be executed.
The Artificial Intelligence does never directly interact with the system. It only can communicate with the security layer of the client software. This security layer assures the user's approval before any command execution.
You can invoke the Admin Companion client with the command: ai
Usage: ai [options] | [max request token size] [model] [natural language request]
You only can give either an option or a natural language request, but never both at the same time.
[options]: See Command Line Parameters below
[max request token size]: -s <number of tokens> or --size <number of tokens>:
[model]: -m <model-name> or --model <model-name>:
ai -m gpt-5-mini "Are you there?"[natural language request]:
ai "I'd like to create a backup script with 10 rotating files for the content of the path /mnt/data"ai find and list the configuration files of the application xyz (you find the application in /usr/xyz)ai find and list the configuration files of the application xyz \(you find the application in /usr/xyz\)ai I'd like to create a backup script with 10 rotating files for the content of the path /mnt/dataai I would like to create a backup script with 10 rotating files for the content of the path /mnt/dataai I'd like to create a backup script with 10 rotating files for the content of the path /mnt/data'ai "I'd like to create a backup script with 10 rotating files for the content of the path /mnt/data"ai without any parameter and enter your instruction interactively:
$ ai
Edit your input below. Submit with Alt+Enter:
I'd like to create a backup script.
I want to backup: /mnt
Please tar zip the files
The tarball should be written to /backup
<Alt-Enter>
Samples:
ai "Are you there?"ai -s 100000 "Are you there?"ai -vai -t "We analyze an issue with our web server not reacting to requests on port 443."ai
-h or --help-l or --list-c or --clear-messages-b [<background>] / --set-background [<background>]-rb or --remove-background-sb or --show-background-t [<topic>] / --set-topic [<topic>]-rt or --remove-topic -st or --show-topic-rm or --remove-memory -sm or --show-memory-er or --enable-use-release -dr or --disable-use-release -ek or --enable-knowledge -dk or --disable-knowledge -ec or --enable-citations -dc or --disable-citations -v or --version ac-ops is a policy-enforced automation client for operational workflows. It is not a general-purpose agent: it can only act through tools that are explicitly allowed by a selected use-case configuration (YAML).
Use it to embed LLM assistance into automation (cripts, cron jobs, DevOps, CI pipelines, incident runbooks) with:
run_as rules)High-level workflow:
1) Select a use-case YAML that defines allowed tools, guardrails, and a default instruction for the LLM.
2) Provide an optional event payload (e.g. an error log).
3) ac-ops sends the instruction + payload to the backend LLM.
4) The backend may request tool executions; ac-ops executes only tools allowed by the use-case.
5) The final answer is streamed to stdout for downstream processing in the pipeline
Prerequisites (/etc/admin-companion/admin-companion.cfg):
ADMIN_COMPANION_DIALOGUE_APIADMIN_COMPANION_DIALOGUE_API_VERADMIN_COMPANION_KEY (API key)The call below needs docker to be installed on the machine.
It reads the sample docker error event from stdin and will try to find evidenves on your machine, which obviously will not be found. Give it a try.
It has console debugging activated, so you see a live execution transcript on the console. This mixes with the ac-ops output, and is not intended to be used in production use.
Replace <prefix> with /usr (or /usr/local for FreeBSD). This depends on the OS standard installation locations.
ac-ops \
--use-case <prefix>/libexec/admin-companion/ops/use-cases/docker-issue-analysis.yaml \
--event - \
--debug-console \
<<'EOF'
2026-02-20T17:35:02.458350834Z container die 7af8edcbaaac4000d38709787d6241a20715e48d476ca7d7d44446257d2175ac (exitCode=1, image=alpine:3.19, name=acme-crm)
EOF
Alternatively stream your own real Docker error message into the use case.
Create a file /etc/admin-companion/ops/use-cases/test-ls-path.yaml with this content
id: test.ls.path.v1
description: Execute the tool LsPath for testing
# Whether to use Admin Companion's internal knowledge base
use_internal_knowledge: true
# Whether to use this client's platform release information to tailor LLM's answers better to this system
use_platform_release_information: true
instruction: |
Execute the tool LsPath twice for testing purposes:
- Once with disallowed parameter /var/log/apache2
- Once with allowed parameter /var/log
Show a summary of what you find.
Rate, whether the output is what you expected and why.
output_mode: text
tools:
- name: LsPath
run_as: sudo
tool_config:
LsPath:
restrict:
path:
match: path_prefix_real
allow:
- /var/log
deny:
- /var/log/apache2
Then execute this command:
ac-ops --use-case /etc/admin-companion/ops/use-cases/test-ls-path.yaml --debug-console
ac-ops --use-case PATH [--event PATH|-] [--debug-console] [instruction]
--use-case PATH
Required.
Path to a use-case YAML (see below).
--event PATH|-
Optional.
Adds an event payload to the request.
Use - to read from stdin.
--debug-console
Optional.
Prints a human-readable execution transcript to stdout, including:
request context (use-case ID, instruction, event payload)
each tool run (tool name, whether it ran as user or sudo)
tool stdout/stderr (bounded; optionally redacted)
instruction (positional)
Optional.
Overrides the use-case’s default instruction.
0 - request finished successfully2 - invalid arguments/config, missing backend environment, backend/tool-loop errorAt startup ac-ops loads the configuration:
1) API key (only if ADMIN_COMPANION_KEY is not already set in the environment):
~/.admin-companion/api-key/etc/admin-companion/api-key2) config file:
/etc/admin-companion/admin-companion.cfgThe config file does not override variables already set in the environment.
Use-cases are the safety and repeatability boundary for automation.
A use-case exists to:
user or via passwordless sudoFileQuery may read)The definition of a tool follows this chain:
Implementation (only needed for user-provided tools. No implementation work is needed if you use vendor-shipped tools and vendor-shipped use-cases unchanged.)
a. Define tool's functionality and parameters (.../admin-companion/ops/tools-spec/)
b. Implement tool wrapper for example as a shell script which consumes the parameter above and implements the defined functionality (admin-companion/ops/tools-bin/)
c. Register tool to ac-ops and map it to executable wrapper (.../admin-companion/ops/tools.yaml)
d. Allow tool and define policies in the use-case (.../admin-companion/ops/use-cases/)
Execution
a. Your machine invokes ac-ops with a use case.
b. Reqest is dent to the LLM
c. LLM wants to execute a tool
d. ac-ops checks tool is allowed for the use-case and call follows policies
e. If so, executes the wrapper script (.../admin-companion/ops/tools-bin/)
Vendor provided tools reside in <prefix>/libexec/admin-companion/ops/...
Admin overrides and additional admin provided tools reside in: /etc/admin-companion/ops/...
<prefix> is /usr or /usr/local depending on where ac-ops is installed.
The structures under <prefix>/libexec/admin-companion/ops (vendor-provided) and /etc/admin-companion/ops (override and user defined) are identical.
You can look into the vendor-provided tools to learn about how to implement tools in the override and user defined directory.
Ops tools are executed locally by ac-ops as external wrappers under:
<prefix>/libexec/admin-companion/ops/tools-bin/<impl>/etc/admin-companion/ops/tools-bin<prefix> is /usr or /usr/local depending on where ac-ops is installed.
Argument mapping:
arguments as JSON to ac-ops.{"unit":"docker.service"} -> --unit docker.service{"full":true} -> --fullWrapper implementation conventions:
sh scripts and can optionally source "$DIR/lib/common.sh" (shipped under tools-bin/lib/common.sh)--help and -h can be supported via common.sh helper _ac_handle_help usage "$@" and an admin provided usage function_ac_parse_args and validators from lib/common.sh--no-pager)To see, how the helpers in common.sh can be used, it's best to review some vendor provided implementations.
Available tools are declared in the local tool registry (tools.yaml). Only these tools can be used by a use case definition.
<prefix>/libexec/admin-companion/ops/tools.yaml/etc/admin-companion/ops/tools.yamlMost tools are executed via local wrapper implementations under tools-bin/.
<prefix>/libexec/admin-companion/ops/tools-bin//etc/admin-companion/ops/tools-bin/FileQuery is a builtin-security tool implemented in the client (no external wrapper).
Current tool names:
DockerEventsDockerInfoDockerInspectDockerLogsDockerNetworkInspectDockerNetworkLsDockerPortDockerPsDockerStatsSnapshotDockerSystemDfDockerVolumeInspectDockerVolumeLsFileQueryJournalctlUnitSystemctlStatusA use-case YAML defines:
id: stable identifierdescription: short text, only for documentation purposesuse_internal_knowledge: true|false -> Define, whether Admin Companion's internal knowledge base shall be used or notuse_platform_release_information: true|false -> Define, whether ac-ops should retrieve OS and release locally and send this information to the LLM (to tailor answers better to the system)instruction: default instruction for the LLM (can be overridden by positional instruction to the ac-ops command)background: optional background context (e.g. specific system configurations, pathes, etc.) passed to the LLM (use-case specific)output_mode: text|json -> hint to the LLM how to format the final answertools: allowed tools and how they run (run_as sudo|user)tool_config: per-tool policiesLocations:
<prefix>/libexec/admin-companion/ops/use-cases/*.yaml/etc/admin-companion/ops/use-cases/*.yamltool_config policies (syntax and semantics)tool_config defines per-tool parameter restrictions as policies. Restrictions are expressed as allow/deny lists per parameter.
Syntax:
tool_config:
<ToolName>:
restrict:
<param>:
match: exact | path_prefix_real # optional
allow:
- <string>
- <string>
- ...
deny:
- <string>
- <string>
- ...
Semantics:
tool_config is missing for a tool, or restrict is missing, or restrict.<param> is missing: that parameter is unrestricted.restrict.<param> is present:deny, the call is being rejected by ac-ops.allow is non-empty: the value must match one entry in allow.allow is empty: the parameter is effectively denied (deny-all).Matching:
match controls how allow/deny entries are interpreted by ac-ops:exact (default): exact string match.path_prefix_real: treat allow/deny entries as absolute directory prefixes; the requested path is canonicalized (real path) and must be under an allowed directory.match is omitted, it defaults to exact.FileQuery.restrict.path always uses path_prefix_real.Enforcement:
tool_config.<Tool>.restrict.* rules are enforced client-side before executing external tools.match: path_prefix_real semantics.Note: tool_config is injected into tool descriptions sent to the LLM. Keep it short.
Hard limit: 32768 bytes (JSON-serialized). But should be far smaller!
backgroundUse-cases may define background (free-form text) to provide stable context to the LLM for that use-case.
background based on what was missing or unclear.output_modeoutput_mode is only a hint to the LLM. It improves consistency but is not a hard guarantee.
Your automation should be prepared to handle:
output_mode: jsonIf you require strict machine-readable outputs, add validation in your pipeline step.
id: docker.issue.analyze.v2
description: Analyze a Docker issue from an event payload (log line/snippet)
# Whether to use Admin Companion's internal knowledge base
use_internal_knowledge: true
# Whether to use this client's platform release information to tailor LLM's answers better to this system
use_platform_release_information: true
# This use case is intended for root cause analysis based on a Docker error snippet.
# Ths error snippet is either piped into ac-ops via --event - or by providing it in a file via --event <filename>
background: |
The docker installation is fully local.
instruction: |
Analyze the provided Docker event/log snippet.
By collecting evidence via allowed tools, identify the likely root cause of the issue as well as the proposed steps to fix it.
Output the results as ticket to an Administrator, which handles the issue then.
Format of the ticket:
```TICKET
Use Case: <use case id>
Event: <dump of the event>
Result of the first analysis:
<result of your analysis>```
output_mode: text
tools:
- name: DockerInfo
run_as: sudo
- name: DockerPs
run_as: sudo
- name: DockerInspect
run_as: sudo
- name: DockerLogs
run_as: sudo
- name: DockerEvents
run_as: sudo
- name: DockerStatsSnapshot
run_as: sudo
- name: DockerNetworkLs
run_as: sudo
- name: DockerNetworkInspect
run_as: sudo
- name: DockerPort
run_as: sudo
- name: DockerVolumeLs
run_as: sudo
- name: DockerVolumeInspect
run_as: sudo
- name: DockerSystemDf
run_as: sudo
- name: SystemctlStatus
run_as: sudo
- name: JournalctlUnit
run_as: sudo
- name: FileQuery
run_as: sudo
tool_config:
FileQuery:
restrict:
path:
match: path_prefix_real
allow:
- /var/log
- /etc/docker
deny:
- /var/log/apache2
SystemctlStatus:
restrict:
unit:
match: exact
allow:
- docker.service
- containerd.service
Examples: DockerInfo, DockerPs, DockerInspect, ...
ac-ops resolves a local wrapper implementation under tools-bin/ and executes it.tools-spec/<impl>.yaml (see below).Currently: FileQuery
tools.yamlac-ops uses a local tool registry (tools.yaml) that maps tool name to:
impl: implementation script name (looked up under tools-bin/)timeout_seconds: max runtime for that toolSearch order for the tool registry:
<prefix>/libexec/admin-companion/ops/tools.yaml/etc/admin-companion/ops/tools.yaml<prefix> is /usr or /usr/local depending on where ac-ops is installed.
If you want to extend the vendor default tools.yaml, you must copy the file into the respective location in the Admin override directory and extend it then.
Otherwise you loose the vendor defined tools.
Search order for the implementation script:
<prefix>/libexec/admin-companion/ops/tools-bin/etc/admin-companion/ops/tools-bin<prefix> is /usr or /usr/local depending on where ac-ops is installed.
Registry structure:
builtin_tools: ac-ops built-in toolsFileQuery (builtin-security)external_tools: tool implementations executed via an external wrapper on the client machine (either vendor-provided or user-defined)DockerInfo, DockerLogs, SystemctlStatus, LsPathExample:
builtin_tools:
FileQuery:
impl: <internal>
timeout_seconds: 15
external_tools:
DockerInfo:
impl: DockerInfo
timeout_seconds: 15
LsPath:
impl: ls_path_v1
timeout_seconds: 10
<impl>?<impl> is the filename of the tool implementation that is executed on the client.
Example:
DockerInfo<impl>: DockerInfo.../admin-companion/ops/tools-bin/DockerInfo
... follows the resolution described above.tools-spec/<impl>.yamlFor tools whose function specs are client-provided ("external_tools" in tools.yaml), the
specs are stored as separate YAML files by implementation name:
Vendor provided:
/usr/libexec/admin-companion/ops/tools-spec/<impl>.yaml
or /usr/local/libexec/admin-companion/ops/tools-spec/<impl>.yaml
Admin override or additional admin provided tools:
/etc/admin-companion/ops/tools-spec/<impl>.yamlFile format:
description: <string>
parameters:
type: object
properties:
<param>:
type: <string|integer|boolean>
description: <string>
# Optional JSON-schema fields:
# ATTENTION:
# These fields are only a weak guidance for the LLM, not hard constraints for execution
# Hard constraints need to be managed either in the use-case definition or in the execution wrapper!
# enum: [..]
# minimum: <int>
# maximum: <int>
...
required: [<param>, ...] # optional
Notes:
description is recommended (it helps the LLM use the tool correctly).When executing a tool, ac-ops resolves the implementation in this order:
1) admin override
- /etc/admin-companion/ops/tools-bin/<impl>
2) vendor default (based on install prefix)
/usr/libexec/admin-companion/ops/tools-bin/<impl>/usr/local/libexec/admin-companion/ops/tools-bin/<impl>FileQuery is a built-in tool without an external wrapper and is used by the assistant to inspect local files safely, typically logs.
It is designed to support:
ac-ops logsIf debug/audit logging is enabled, you will typically see:
ac-ops has 3 output channels:
--debug-console./etc/admin-companion/admin-companion.cfg.Debug log:
/var/log/admin-companion/ac-ops.debug.jsonl~/.admin-companion/ac-ops/debug.jsonlAudit log:
/var/log/admin-companion/ac-ops.audit.jsonl~/.admin-companion/ac-ops/audit.jsonlFollowing is a sample configuration, typically at the end of /etc/admin-companion/admin-companion.cfg:
# Debug log (JSONL)
ops.debug.enabled=true
ops.debug.destination=auto
ops.debug.max_bytes=1048576
ops.debug.backup_count=2
ops.debug.max_record_bytes=65536
ops.debug.redact=true
# Audit log (JSONL)
ops.audit.enabled=true
ops.audit.destination=auto
ops.audit.max_bytes=1048576
ops.audit.backup_count=2
ops.audit.max_record_bytes=65536
ops.audit.redact=true
# Audit elements (CSV)
# Note: if ops.audit.enabled=true and ops.audit.elements is empty/missing, ac-ops fails early.
ops.audit.elements=context,tool_call,tool_exec,tool_result,errors
ops.debug.enabled / ops.audit.enabledtrue|falseops.debug.destination / ops.audit.destinationWhere the JSONL log file is written:
system/var/log/admin-companion/...ac-ops failsuser~/.admin-companion/...auto (default)ops.debug.max_bytes / ops.audit.max_bytesops.debug.backup_count / ops.audit.backup_countops.debug.max_record_bytes / ops.audit.max_record_bytesops.debug.redact / ops.audit.redacttrue|false (default: true)ops.audit.elementsCSV list of audit elements to emit into the audit log. If an element is not listed, it is not written.
Currently emitted element names:
contexttool_calltool_exectool_resulterrorsWhen ops.*.redact=true, redaction is applied to debug and audit logs (and the debug console transcript).
Redaction is line-based and aims to remove secret values while keeping context.
Example:
password=supersecret becomes password= <redacted>If you see:
Missing ADMIN_COMPANION_DIALOGUE_API or ADMIN_COMPANION_DIALOGUE_API_VERMissing ADMIN_COMPANION_KEYSet these in environment or /etc/admin-companion/admin-companion.cfg (and ensure the API key file exists).
If a tool is configured with run_as: sudo:
sudo -n (non-interactive)not_found: file does not exist (strict path resolution)forbidden: path is outside allowlist or under denylist.The following files and folders are used by Admin Companion. Some are shared across 'ai' and 'ac-ops' clients, others are client-specific.
$HOME/.admin-companion/
api-key: Optional API key file. If ADMIN_COMPANION_KEY is set in the environment, this file is not used./etc/admin-companion/admin-companion.cfg: Admin Companion configuration file.api-key: Optional system-wide API key file. If ADMIN_COMPANION_KEY is set in the environment, this file is not used.symlink_name: Internal file for installation/deinstallation. Never change this file./usr/bin/ or /usr/local/bin/$HOME/.admin-companion/
admin-companion.log: Log file of the interactive client. The file is rotated with two files at a size of about 1M each.admin-companion.bill: This file logs for each request the number of tokens consumed. The file is rotated with two files at a size of about 1M each.conversation_history.pickle: This file stores the conversation history persistently (also across reboots)./etc/admin-companion/ops/use-cases/: Use-case definitions (YAML) to define allowed tools and guardrails for ac-ops.tools.yaml: Tool registry (YAML) that defines available tools and their implementations.tools-bin/: Optional admin-provided tool wrapper implementations (executables).tools-spec/: Optional admin-provided tool specs (YAML) for external tools (client-provided function specs).$HOME/.admin-companion/ac-ops/debug.jsonlaudit.jsonl/var/log/admin-companion/ac-ops.debug.jsonlac-ops.audit.jsonl/usr/libexec/admin-companion/ops/ or /usr/local/libexec/admin-companion/ops/On the web console dashboard you see an overview of your balances and your usage on montly base (6 month) and daily basis (current calendar month).
On this page you can see the meta date of the latest requests, which have been made on one of your API keys (without the contents of the request).
API keys are used to authenticate the Admin Companion client's requests. Keep your API keys secret like a password!
You can create, manage and delete your API keys on the API Keys page in the web console.
You have the following options:
The My Profile page on the web console allows you to change your Name, VAT Id and Address. You cannot change your country, company name or email address.
This page shows your account balances. There are two balances:
Automatic Refill feature: Standard behaviour is, that in case of full consumption of all your balances, Admin Comanion client declines further requests with an "Account limit reached" message.
If you activate the Automatic Refill feature, Admin Companion automatically charges your payment method again, when you consumed all your balances within a billing cycle. Any refills go to the non-expiring balance, which follows the mechanisms, as described above.
Refill is always the same amount, as the recurring fee.
Don't forget to click on "Update Account Settings" after changing the auto-refill to become effective.
Transactions: On the Account page you also can see your last 30 transactions (like recurring payments, refills, payment method changes, etc.)
On the subscription page you see, which Plan you currently are subscribed to. You can activate a subscription, change to another subscription or cancel your subscription.
Change plan: When you change between the plans S, M, L, the recurring fee of the new plan is immediately charged to your stored payment method and added to the non-expiring balance (See "Account" for details). Your further usage then will be billed immediately at the unit price of the new plan.
Update payment method: On this page you can also update your payment method.
Cancel subscription: Cancellation will be scheduled to the end of the billing cycle. You can continue to use Admin Companion until the end of the billing cycle.
When your refill feature is activated, your payment method will still be charged for possible refill actions.
When you cancel a subscription, all non-expiring balance will expire at the end of the billing cycle.
Within the last about one hour before the end of a billing cycle, it is not possible to perform any changes on the subscription.
Your account will still be available for at least one year, so you can decide to subscribe to a plan later again.