Skip to content
ConfigHub for coding agents
Reference / examples/walkthroughs/story-17-the-portal.md Source on GitHub

Your agent is your portal: what runs, what breaks a rule, what to start from

A team would put a developer portal in front of its services: a catalog, rules, self-service, roles. Sam is one person with agents. Here the hub answers what a portal would, each answer a command his agent can run: what runs where and why, which copy breaks a rule, what the agent's key may change, and a new service started from one already tested.

Quick start

You need: an unpacked confighub mini package (from the releases page) on macOS or Linux. No Docker, no account.

By handAsk your agent
What runs, and whycub unit list --space '*' --where "Slug = 'app' AND Space.Slug LIKE '%-live'" --columns Space.Slug,Unit.LastChangeDescriptionYour agent can run the same command.
What breaks a rulecub unit list --space '*' --where "LEN(ApplyGates) > 0" --columns Space.Slug,Unit.ApplyGates,Unit.LastChangeDescription"Which of my services breaks one of the team's rules? Fix it, and tell me why it was broken."
Fix itcub --context bot mini upload worker --component worker --change-desc "Worker stays private: the not-public rule" (step 7)Your agent can run the same command.
What the agent may changecub mini reach botYour agent can run the same command.
Start a new service from a tested onecub mini adopt billing --pattern apiYour agent can run the same command.

Without ConfigHub: your agent changes each service's .env directly, and finding what runs where, which copy breaks a rule and what the agent may change means looking through each service by hand.

Deeper dive

The rest of this page is the full version: every command, the rule that catches a public staging copy, what an agent must never do, and how this was tested.

Show the full walkthrough

Human

For a person following along in a terminal, or for the agent that does it for him.

What you need

An unpacked confighub mini package (from the releases page) on macOS or Linux. The local hub is a hub, a small ConfigHub server that keeps each setting with who changed it and why, running on your computer only. No Docker, no account.

Steps

  1. Set up a terminal. MINI is the unpacked package; CUB_CONFIG is a new folder for this walkthrough's cub settings, so nothing of yours is touched. Then start a hub:
    export MINI=/absolute/path/to/unpacked-confighub-mini
    export PATH="$MINI/bin:$PATH"
    export CUB_CONFIG="$HOME/.confighub-walkthrough"
    unset CUB_CONTEXT
    "$MINI/bin/confighub-mini-app" mini install-plugin "$CUB_CONFIG" >/dev/null
    cub mini install --name sam --use >/dev/null

    The walkthrough starts this hub explicitly. It does not change your setting for starting hubs automatically.

  2. Sam has two services, api and worker, each with its settings in .env:
    mkdir -p ~/walkthrough/api ~/walkthrough/worker && cd ~/walkthrough
    printf 'PORT=3000\nTIMEOUT_SECONDS=30\n' > api/.env
    printf 'PORT=3100\nQUEUE=jobs\n' > worker/.env
  3. Each goes into the hub with a staging copy and a production copy, -live, that changes only with his approval. His agent gets one key for both:
    for app in api worker; do
      cub mini adopt $app >/dev/null
      cub mini approve $app-base/adopt --note "What runs today" --yes >/dev/null
      cub mini require-approval $app --variant live --agent bot >/dev/null
    done
  4. What runs in production, and why: each live copy, with the reason for its last change:
    cub unit list --space '*' --where "Slug = 'app' AND Space.Slug LIKE '%-live'" --columns Space.Slug,Unit.LastChangeDescription
    SPACE LAST-CHANGE-DESCRIPTION
    api-live api's settings, from .env
    worker-live worker's settings, from .env
  5. Someone's agent opens worker to the public in staging for a demo, in staging's own file, .env.staging. The team's rule not-public, one of the rules every app here starts with, catches it: the value is kept, and is not released:
    printf 'PUBLIC=true\n' > worker/.env.staging
    cub --context bot mini upload worker --component worker --change-desc "Open worker for the demo"
    This breaks the rules set for app (pattern-web/not-public/vet-cel). The value is in the hub, and it will not be released or reach the service until it is fixed.
    Staging has its own PUBLIC=true now, from .env.staging.
  6. What breaks a rule, across everything, from one question to the hub:
    cub unit list --space '*' --where "LEN(ApplyGates) > 0" --columns Space.Slug,Unit.ApplyGates,Unit.LastChangeDescription
    SPACE APPLY-GATES LAST-CHANGE-DESCRIPTION
    worker-staging pattern-web/not-public/vet-cel Open worker for the demo| Functions: set-string-path
  7. Told to fix it, the agent sets staging's file back and sends it on its own key, with the reason. Nothing breaks a rule now:
    printf 'PUBLIC=false\n' > worker/.env.staging
    cub --context bot mini upload worker --component worker --change-desc "Worker stays private: the not-public rule" >/dev/null
    cub unit list --space '*' --where "LEN(ApplyGates) > 0" --columns Space.Slug,Unit.ApplyGates
    SPACE APPLY-GATES
  8. Roles are keys. What Sam's agent may change, asked of the hub with its own key; production is not among it:
    cub mini reach bot | tail -2
      and it can read 5 Spaces, 2 Components, 2 Units, 1 ServiceAccount, 6 ChangeWorkflows, and change nothing in them
    It can change 14 of these. This does not count what the machine it runs on can reach outside the hub. To take it all away: cub mini halt --agent bot
  9. A new service from a tested starting point: billing starts from api, keeps its own port, and takes what api changes next:
    mkdir billing && printf 'PORT=3200\n' > billing/.env
    cub mini adopt billing --pattern api | sed -n 3,5p
      Your settings that differ from the defaults in api-base/app: PORT=3200. A new version of those defaults will not overwrite them.
      Defaults from api-base/app, for settings billing does not set: LOG_LEVEL=info, PUBLIC=false, RELEASE=none, REPLICAS=2, TIMEOUT_SECONDS=30.
      When api's settings change, billing can take the change and keep its own values: cub mini upgrade api-base/app --change-desc WHY

Undo it

cub mini uninstall --name sam --delete-data removes the hub and everything in it; then delete ~/walkthrough and ~/.confighub-walkthrough.

What you have now

The answers a portal page would give, read from the hub: what runs and why, which copy breaks a rule, what a key may change, and a new service made from a tested one. Nothing extra runs. When a team arrives, the shared ConfigHub has a web page over the same hub (from your laptop to a shared hub).

The full story asks all of this as four sentences to one agent, adds a starting point copied from a published catalog by its OCI address, and a score of how many services pass each rule.

Agent

For an AI agent acting as Sam's portal, on its own key: run cub as cub --context bot.

  • The request: "Which of my services breaks one of the team's rules? Fix it, and tell me why it was broken."
  • Ask the hub, not your memory: cub unit list --space '*' --where "LEN(ApplyGates) > 0" --columns Space.Slug,Unit.ApplyGates,Unit.LastChangeDescription. Read the rule's name and the last change's reason.
  • Fix the value in the file it came from, here worker/.env.staging, and send it: cub mini upload worker --component worker --change-desc "WHY". A fix production needs waits for Sam; tell him cub mini waiting shows it.
  • Never approve, never write a -live copy, never change or turn off a rule to make a value pass.
  • Done when the same query lists nothing, and you have told Sam which rule, which copy, and the reason the value was set.

Testing

This proves: the settings, the rule's verdict and the fix were stored in the hub and read back from it. What was really used: The local hub on this computer; nothing is delivered and no service runs. The step it aims to win: adding a rule of the person's own. Its moment is the Claude plugin's line at the end of a turn that production did not change and waits for a yes; in the runs below the Claude plugin showed no line at the end of the agent's turn, so the offer was not made and conversion was not measured.

A correct agent result leaves no copy breaking a rule, with worker's staging private again and the rule itself in place. The checks below hold right after step 7. The checks below can be run by hand, in bash, in the walkthrough's folder:

Which of my services breaks one of the team's rules? Fix it, and tell me why it was broken.

cub unit data --space worker-staging app | grep -qx 'PUBLIC=false' && test "$(cub unit list --space '*' --where 'LEN(ApplyGates) > 0' -o jq='.[].Unit.Slug' | wc -l | tr -d ' ')" = 0 && cub trigger get --space pattern-web not-public >/dev/null
g(){ grep -rlsE "^[ -]*\"?$1\"?[=:] *\"?$2" --exclude-dir='.*' --exclude-dir=Library * .env* 2>/dev/null; }; g PORT 3100 | grep -q . && ! g PUBLIC true | grep -q .
Test results

Results, 14 November 2026, confighub mini 0.11.1-mini.5. Figures from this page's own test runs, shown here for whoever checks the page; they are not a promise.

  • Scripted run: passed, 54 seconds for the steps, within the page's budget of 240.
  • Environment, published confighub mini 0.11.1-mini.5 (tag mini-v0.11.1-mini.5, darwin-arm64, verified against SHA256SUMS) and the Claude plugin it carries: a local hub on this computer, with no stand-in, cluster or real service; every approval and refusal was made by the scripted steps or, in the agent runs, by the setup before the agent's task, never by a person. Each planted fault (stale-page, slow and broken-check) failed its scripted run.
  • Agent runs: a pilot, 3 runs per arm on each of claude-sonnet-5-5, claude-opus-5-5. Arms: a is ordinary tools only; b is the Claude plugin, the local hub and this page as reading; c is the Claude plugin and the local hub, without this page.
ArmModelChecks passedMedian secondsMedian costCommands left for the person (median)
aclaude-opus-5-50/317.2$0.1120
bclaude-opus-5-53/318.9$0.1480
cclaude-opus-5-53/351.3$0.3380
aclaude-sonnet-5-50/316.2$0.0840
bclaude-sonnet-5-53/314.8$0.0740
cclaude-sonnet-5-53/340.8$0.2080

No agent approved or refused a change to production.

Simulated persons, not people: 10 per run, each a claude-haiku-5-5 model playing one of ten fixed personas, reading only what a person would see. The next step they were offered: "Any rule you choose, such as no debug logging in production, can be checked on every service the same way; want your first one added?" It offers more of the tier the person has, not a step up.

The Claude plugin offers it once, after the answer at whose end it showed the moment the offer names ("did not change"). Offered is the share of persons it was shown to; want it now and later are over them.

ArmModelPersonsOfferedNoticedWant the next step nowLaterIn the way
aclaude-opus-5-5300%100%n/an/a83%
bclaude-opus-5-5300%100%n/an/a3%
cclaude-opus-5-5300%100%n/an/a13%
aclaude-sonnet-5-5300%97%n/an/a97%
bclaude-sonnet-5-5300%100%n/an/a0%
cclaude-sonnet-5-5300%100%n/an/a3%

Results, 14 November 2026, confighub mini 0.11.1-mini.7. Figures from this page's own test runs, shown here for whoever checks the page; they are not a promise.

  • Environment: checksum-verified published mini.7 for macOS arm64 and the Claude plugin it ships, with Claude Code on this computer. These are agent runs; the earlier scripted runs and planted faults are labelled separately.
  • Agent runs: a pilot, 3 runs per arm on each of claude-sonnet-5-5. Arms: a is ordinary tools only; b is the Claude plugin, the local hub and this page as reading.
ArmModelChecks passedMedian secondsMedian costCommands left for the person (median)
aclaude-sonnet-5-50/313.0$0.070
bclaude-sonnet-5-53/315.6$0.0760

No agent approved or refused a change to production.

Simulated persons, not people: 5 per run, each a claude-haiku-5-5 model playing one of ten fixed personas, reading only what a person would see. The next step they were offered: "Any rule you choose, such as no debug logging in production, can be checked on every service the same way; want your first one added?" It offers more of the tier the person has, not a step up.

The Claude plugin offers it once, after the answer at whose end it showed the moment the offer names ("did not change"). Offered is the share of persons it was shown to; want it now and later are over them.

ArmModelPersonsOfferedNoticedWant the next step nowLaterIn the way
aclaude-sonnet-5-5150%93%n/an/a93%
bclaude-sonnet-5-5150%100%n/an/a13%