Skip to content

[Sandbox] Sandbox-scoped credentials — no production secrets in a sandbox #194

Description

@Sam123ben

Part of the Agent Sandbox & Evaluation epic (#192). Splits the credential half out of
#180 because it is the single highest-risk part of the sandbox.

Goal

No production secret ever reaches a sandbox. An agent under evaluation is, by
definition, running unvalidated instructions against tools — treat its credentials as
if the agent were hostile.

Today (grounded)

PrincipalLLMResolver / PrincipalSCMResolver resolve the triggering user's own
connectors, and job_runner.py forwards the matching provider key into the Job env.
That is exactly right for production and exactly wrong for a sandbox: an eval run would
execute with the user's real GitHub PAT and real LLM key against real orgs.

Tasks

  • SandboxCredentialResolver — resolves the sandbox's own scoped credentials, never
    the principal's production connectors, unless the sandbox spec explicitly opts a
    named connector in and the user confirms.
  • LLM keys: allowed (an eval must call a model), but metered against the sandbox
    budget and attributed to the sandbox, not the user's production spend.
  • SCM / cloud / GitOps credentials: denied by default. A sandbox that needs SCM
    gets a scoped test-org token, not the user's PAT.
  • Sandbox ServiceAccount is distinct from the pipeline SA, with no WIF binding to
    production GCP service accounts.
  • Assert it in tests: a sandbox Job spec never contains a key that came from a
    production connector.
  • Audit every credential grant into a sandbox.

Acceptance

Given a user with real GitHub and Anthropic connectors, creating a sandbox and invoking
it produces a Job whose env contains the sandbox-scoped LLM key and no SCM/cloud
credential, and the grant is audited.

Plan: docs/plans/agent-sandbox-evals/IMPLEMENTATION-PLAN.md §7

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestsandboxAgent sandbox / isolated agent execution

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions