Skip to content

Restrict the sandbox to AssemblyAI logins#208

Merged
alexkroman merged 4 commits into
mainfrom
claude/zealous-bardeen-52nvr2
Jun 17, 2026
Merged

Restrict the sandbox to AssemblyAI logins#208
alexkroman merged 4 commits into
mainfrom
claude/zealous-bardeen-52nvr2

Conversation

@alexkroman

Copy link
Copy Markdown
Collaborator

The sandbox runs on internal infrastructure that an external account can
neither reach nor authenticate against, yet --sandbox/--env sandbox000
and the sandbox-only commands (speak/dub/agent-cascade) were offered to
everyone. Gate the whole sandbox surface on the login's email domain:

  • Capture the email from AMS discovery at browser login and persist it on
    the profile (config.persist_login); API-key-only profiles have none and
    so read as external.
  • core/access.py decides internal vs external from that email
    (@assemblyai.com, fail-closed on a corrupt config).
  • The root callback rejects an internal-only environment for an external
    account with a clean exit-2 error, exempting login so a first-time
    employee can still sign in to the sandbox (which records the email).
  • assembly --help hides the sandbox flags and [sandbox] commands from
    external accounts, restoring them after the render so completion and
    later in-process renders are unaffected.

Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01QqLkQANDitxPuBwkQJuCi4

claude added 4 commits June 17, 2026 02:57
The sandbox runs on internal infrastructure that an external account can
neither reach nor authenticate against, yet `--sandbox`/`--env sandbox000`
and the sandbox-only commands (speak/dub/agent-cascade) were offered to
everyone. Gate the whole sandbox surface on the login's email domain:

- Capture the email from AMS discovery at browser login and persist it on
  the profile (config.persist_login); API-key-only profiles have none and
  so read as external.
- core/access.py decides internal vs external from that email
  (`@assemblyai.com`, fail-closed on a corrupt config).
- The root callback rejects an internal-only environment for an external
  account with a clean exit-2 error, exempting `login` so a first-time
  employee can still sign in to the sandbox (which records the email).
- `assembly --help` hides the sandbox flags and [sandbox] commands from
  external accounts, restoring them after the render so completion and
  later in-process renders are unaffected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QqLkQANDitxPuBwkQJuCi4
The new help-hiding test asserted on raw CliRunner output, which is plain
locally but colored in CI (runners export FORCE_COLOR). Rich splits a flag's
leading dash into its own ANSI span, so `"--profile" in output` fails in CI —
and the negative `"--flag" not in output` checks would pass vacuously, hiding
regressions.

Fix the root cause for the whole suite, not just this test: strip FORCE_COLOR
in conftest at import time (before the app's module-level Rich consoles are
built) and per-test in isolate_env, so output renders the same plain text
locally and in CI. Color-specific tests already build their own forced consoles,
so they're unaffected; this also removes a flaky is_terminal-driven update-check
spawn. Documented in tests/AGENTS.md next to the render-width note.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QqLkQANDitxPuBwkQJuCi4
The previous attempt to make the whole suite colorless (popping FORCE_COLOR in
conftest) does not hold in CI — CI re-colors the help render regardless, so the
test kept failing with the leading-dash-split substring. Revert that and use the
proven approach the --help snapshot suite already relies on: normalize (ANSI
strip) the output before the substring checks, which is correct whether or not
the render is colored. Also stub the post-login update-check so it can't spawn a
detached refresh subprocess (a Popen → ResourceWarning under a tty-reporting
console). AGENTS.md now documents the real guidance: CI color can't be disabled
from the test process — strip ANSI in assertions on rendered output.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QqLkQANDitxPuBwkQJuCi4
@alexkroman alexkroman added this pull request to the merge queue Jun 17, 2026
Merged via the queue into main with commit c4942a6 Jun 17, 2026
19 checks passed
@alexkroman alexkroman deleted the claude/zealous-bardeen-52nvr2 branch June 17, 2026 04:11
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.

2 participants