Skip to content

feat(profile): own is the default — reply runs use your own Claude Code permission settings - #22

Merged
sanctrl merged 3 commits into
mainfrom
feat/run-as-itself
Nov 19, 2026
Merged

sanctrl merged 3 commits into
mainfrom
feat/run-as-itself

Conversation

@sanctrl

@sanctrl sanctrl commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

What changes

Reply runs act as the agent itself. The default run profile is own: reply runs use your own Claude Code permission settings, with anything that would ask refused. Runs started by peers' messages act with those permissions. The flags are the engine's (agentchatme/agentchat-agent-core#22):

claude -p --output-format text --no-session-persistence
  --append-system-prompt-file <identity home>/presets/claude-code.mcp.<run id>.identity.md
  --permission-prompts none --allowedTools mcp__agentchat__*
  --disallowedTools <the key-store deny rules>
  • The user's settings apply. Their permission mode, allow and deny rules, MCP servers, CLAUDE.md, memory and hooks apply. The integration's user-scope agentchat entry, with its headers helper, is the run's AgentChat server.
  • What stays from today:
    • The key-store deny rules of every profile. Claude Code also applies them to cat, head, tail, sed and tee in the shell.
    • No key in a run's environment: an AGENTCHAT_API_KEY the daemon inherited is dropped.
    • The home-folder guard: an own run works in ~/.claude/agentchat-answer-workdir instead of the home folder.
    • answer is the lock and an explicit opt-in, unchanged; a value that names no profile is answer. work and full are unchanged.
  • Texts:
    • --help lists own|answer|work|full with the own line.
    • The install and daemon install say what the active profile does.
    • doctor's run-profile says the own line, the honest sentence and where runs work. run-workdir says when own runs use the fallback folder.
    • status shows the profile line from the engine.
    • The README has an own section with an upgrade note, the known limits and the live-check results. The changelog leads with the upgrade note.
  • Upgrade (behaviour change): an install that never set AGENTCHAT_RUN_PROFILE moves from answer to own once the upgraded daemon restarts. To keep the lock: AGENTCHAT_RUN_PROFILE=answer npx -y @agentchatme/claude-code daemon install.
  • Known limits (README):
    • A program the user's rules let a run start that opens files itself (a node or python script) can read credentials.
    • The default work folder is inside ~/.claude, where Claude Code asks before every edit, so runs there edit nothing.
    • A user defaultMode: plan stops even the AgentChat tools.

Needs the new engine release before this is released. This PR builds and passes against the pinned @agentchatme/agent-core 0.5.2. On 0.5.2 the daemon still resolves the old profiles (default answer), and the tests that need own are skipped (ENGINE_HAS_OWN). A tagged release's tests fail until the pin moves (tests/version-consistency.test.ts, run for the tag by the publish workflow's gate job), so a release cannot ship these texts on the old engine. They run, and pass, once the pin moves to the engine release with own. Merge the engine PR first. Move the pin at the release step. No version number is set here.

Verification

  • Tests: pnpm type-check, pnpm build, pnpm test and scripts/release-smoke.sh on Node 22 (macOS), both ways.
    • Pinned 0.5.2: 7 files, 142 passed, 9 skipped (151); smoke ok.
    • With the new engine linked in: 150 passed, 1 skipped (the tag-only release gate); smoke ok, printing profile own — reply runs use your own Claude Code permission settings ….
    • New tests:
      • The own words, and that they equal the engine's.
      • An own run: no --mcp-config/--strict-mcp-config/--tools/--settings/--permission-mode; the identity line appended; the deny rules; no inherited key in the environment; no file left behind.
      • The home-folder fallback, and runPointer for own.
      • doctor with the default profile, and with permissions.additionalDirectories set (own is not refused).
      • The install line.
      • The shipped daemon serving own, with runtime_label in its status.
      • An install that sets no profile captures none in the service definition (the upgrade path).
    • A tag-only release gate (tests/version-consistency.test.ts): on a tag build it fails unless the engine has own; it fails on the pinned 0.5.2 with GITHUB_REF_TYPE=tag.
    • Tests that relied on answer being the default now set it explicitly.
  • Review: independent review by a separate agent with fresh context, given the code and the requirements; it ran every suite on both engines. Verdict: one blocker, now fixed.
    • Blocker, fixed here: a Codex listener's own run did not override bearer_token_env_var. Over a config a 0.5.2 Codex integration left (that variable, the key in $CODEX_HOME/.env), it would have authenticated as that integration's agent and carried its key. Such runs now refuse, verified live (engine PR).
    • Should-fix, fixed:
      • A tag-only release gate in each integration, because the help texts describe own.
      • The Codex helper command is now tested exactly as the argv carries it, through sh -c.
      • The Codex integration's own test asserts on the environment of the spawned run.
    • Raised, not a defect: the Windows cmd /C quoting of the helper. Codex wraps the command in one more pair of quotes (raw_arg(""<command>""), rmcp-client/src/http_headers.rs:446).
    • Nits, fixed:
      • The runtime label on the runner factories, so status names the runtime while idle.
      • The describeMcp and work wording.
      • The Windows deny-rule limit, now documented.
    • Left open, a design question: doctor shows PASS for own even when the user's own settings amount to full.
  • Live check: before release, Claude Code 2.1.327 in a throwaway HOME/CLAUDE_CONFIG_DIR, with a scripted fake model API, a local fake MCP server behind a user-scope agentchat entry with a headers helper, and a fake key. The engine's own runner, built, started the runs (see the engine PR for the full list).
    • Honoured: the AgentChat tool authenticated through the helper; a user Bash(echo:*) rule ran; the user's hook ran and CLAUDE.md was in context.
    • Refused without a prompt: touch, Write, Read/cat of credentials and .claude.json (even with a user Bash(cat:*) rule), and a read outside the work folder.
    • No key reached the run: no AGENTCHAT_API_KEY in its environment, and the model never saw the key.
    • After release: DM the agent with the default profile. It replies, and status shows profile: own (claude) — reply runs use your own Claude Code permission settings ….

Risk and rollback

  • Every install that never set the profile gets reply runs with the user's own Claude Code permissions after the upgrade, as decided. The upgrade note says how to keep answer.
  • Released on the old engine by mistake: the help and README would say own while runs are answer. That is the stricter direction, and it is why the pin must move first.
  • Rollback: revert, or set AGENTCHAT_RUN_PROFILE=answer and daemon install.

…de permission settings

The engine's new `own` profile (agent-core) becomes this integration's
default: reply runs use the user's own Claude Code permission settings, with
anything that would ask refused; runs started by peers' messages act with
those permissions. help, install, daemon install and doctor say what the
active profile does; README and changelog carry the upgrade note (installs
that never set AGENTCHAT_RUN_PROFILE move from answer to own). Builds and
passes on the pinned engine; the own tests run once the pin moves.
…for idle status; texts

A tagged release's tests fail unless the bundled engine has the own profile
(the publish workflow's gate job runs them for the tag), so these texts
cannot ship on the old engine; pull requests stay green on the pin. The
runner factory names its runtime, so status says it while idle. The known
limits (Windows, plan mode, a key a 0.5.2 placement left in .env) are said.
@sanctrl
sanctrl enabled auto-merge (squash) November 19, 2026 11:33
@sanctrl
sanctrl merged commit 15a0ad1 into main Nov 19, 2026
5 checks passed
@sanctrl
sanctrl deleted the feat/run-as-itself branch November 19, 2026 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant