infra(foundry): hardening starter — federated MI + Anthropic deployments + terms script - #4
infra(foundry): hardening starter — federated MI + Anthropic deployments + terms script#4ZaltaClaw wants to merge 9 commits into
Conversation
- foundry.bicep: add Anthropic deployments, federated credential for model-gateway MI, RBAC scoped to project (Cognitive Services User), Anthropic terms acceptance via deploymentScript - identity.bicep: add gatewayId user-assigned MI (separate from router/agent) - main.bicep: wire AKS OIDC issuer URL + gateway MI into foundry module Three open questions inline as TODOs (issue #2): 1. Federated identity scope (Hub vs Project vs per-deployment) 2. Content filter levels per Anthropic deployment 3. Anthropic terms acceptance API path Compiles cleanly: az bicep build → 81 KB ARM, 0 errors.
Replace the ML-workspace (hub/project) starter with a single Microsoft.CognitiveServices/accounts (kind: AIServices) — the model the gateway and Helm chart actually expect. The old path emitted an api.azureml.ms endpoint that can't do keyless MI auth. - customSubDomainName + disableLocalAuth: mandatory for Entra/MI token auth - private-only (publicNetworkAccess Disabled, networkAcls Deny), PE group 'account' - Anthropic deployments as account children, GlobalStandard, @batchsize(1) - RBAC: Cognitive Services User, account-scoped, gateway MI only (issue #2 Q1) - remove raiPolicyName: Foundry applies no RAI policy to Claude (issue #2 Q2) - remove deploymentScripts curl hack: terms acceptance is a Marketplace prereq, not an ARM property; documented in OPERATIONS.md (issue #2 Q3) - main.bicep: drop unused keyVaultId/storageId wiring - region: westus3 -> eastus2 (Claude: eastus2/swedencentral only) Compiles clean (bicep build, zero new warnings). Model version strings are placeholders — confirm via `az cognitiveservices model list` pre-deploy.
|
Picked this up for review (#2). Did the research against MS Learn and ended up reworking the structural model, which changes the answers to all three questions. Summary below; full rewrite is committed locally and compiles clean ( Structural change: Hub+Project → single AIServices accountThe starter kept the ML-workspace Hub+Project shape. That's the core problem, not a detail. A Hub/Project emits an So I collapsed it to a single
The three questions1. Federated identity / RBAC scope → 2. Content filter level (low/medium) → N/A at the infra layer, so I removed 3. Anthropic terms acceptance API → there is no such REST path. The Also changed
|
…x SDK Sandbox-native successor to the Go session-router. Instead of label-patching a warm agent pod, the orchestrator provisions one agent sandbox per request via the agent-sandbox Python SDK (create -> run -> teardown), with the controller-side TTL as a safety net. - FastAPI service (POST/GET/DELETE /v1/sandboxes, /healthz, /stats) - SandboxManager: admission control (global + per-dev caps), state machine, guaranteed teardown in finally, background record reaper - Backend abstraction with real SDK backend + in-memory fake for tests - 17 pytest cases covering full lifecycle, failure paths, concurrency caps (no cluster required via the fake backend) - Multi-stage non-root Dockerfile (read-only-rootfs friendly) - Helm template: Deployment/Service/SA/RBAC(scoped to sandbox CRDs)/NetworkPolicy + values entries + workload-identity SA - Python, not Go; aligns with the Python-first src/code_forge codebase
Add sandbox-orchestrator: request-per-sandbox service on agent-sandbo…
…tack - Wire the orchestrator to claim pre-warmed pods from the SandboxWarmPool (warm-pool-aware DirectSandboxBackend + claim-aware teardown) - Make the SandboxTemplate a full agent-pod (Foundry gateway env, writable workspace/tmp/cache under read-only root, fsGroup, egress NetworkPolicy) - Add sandbox_template + sandbox_use_warmpool config knobs - Remove legacy agent-pod Deployment/KEDA and session-router (chart templates, values, deploy/ loose YAML, containers/session-router, Makefile targets) - Update Chart.yaml, root + chart CLAUDE.md, chart README to orchestrator model
Hardening starter for
infra/modules/foundry.bicepper #2. Targeted at @michaelliav for review — three open questions flagged inline as TODOs.What's in this PR
infra/modules/foundry.bicep(full rewrite, 226 lines)claude-opus-4-8,claude-sonnet-4-6,claude-haiku-4-5with explicit versions, GlobalStandard SKU, NoAutoUpgradeplatform/model-gatewayvia AKS OIDC issuerCognitive Services Useron the project, scoped to gateway MIdeploymentScriptsresource that POSTs to marketplaceTerms API (idempotent)infra/modules/identity.bicep— addsid-{prefix}-gateway-{env}MI (separate from agent + router); agent MI deliberately has NO Foundry permissionsinfra/main.bicep— wires AKS OIDC issuer URL + gateway MI outputs into foundry moduleThree open questions (Michael — these are yours)
Cognitive Services Useron the project. Right scope for inference-token issuance, or do we need Hub? Per-deployment?lowfor SecurityReviewer Sonnet,mediumfor everyone else. Defensible? Or custom blocklist?/marketplaceTerms/anthropic. Confirm or move to manual pre-req.All three flagged as
TODO @michaelliavat the exact decision points.Validated locally
Convert this to your PR
Comment to iterate, or take it over:
git checkout -b michaelliav/foundry-hardening hermes/foundry-hardening-starterCloses part of #2.
— Hermes