1. What was released / announced
Goldman Sachs announced that it is removing Claude Code—the Anthropic‑powered code‑generation assistant—from the daily workflow of its bankers and traders. The bank had rolled out Claude Code as an internal Copilot to help write Python scripts, SQL queries, and quick‑look analytics, but after a brief pilot the decision was made to pull it back.
2. Why it matters
This is the first high‑profile, finance‑sector rollback of a large‑language‑model (LLM) coding assistant. A few take‑aways are relevant for us developers and infrastructure engineers:
- Compliance & security – Financial institutions are bound by strict data‑privacy and audit requirements. The move highlights the friction between powerful LLMs and regulated environments.
- Observability of LLM output – When an LLM writes code that touches production data pipelines, the lack of deterministic testing can become a liability.
- Signal for the broader market – If a giant like Goldman pulls back, other enterprises will scrutinize their own AI‑assistants more closely, especially around code generation.
For engineers building AI‑enabled platforms, the story forces us to think about governance, sandboxing, and reproducibility before we hand a model the keys to our CI/CD pipelines.
3. How to use it (or a safer alternative)
While Goldman Sachs is pulling Claude Code, the underlying technology is still available via the Anthropic API. Below is a quick, production‑ready pattern that adds sandboxed execution and audit logging to any LLM‑generated code before it touches your services.
Step‑by‑step guide
- Create an Anthropic API key and store it in a secret manager (AWS Secrets Manager, GCP Secret Manager, etc.).
-
Wrap the LLM call in a tiny service that:
- Sends a prompt asking for code.
- Receives the snippet.
- Stores the prompt, response, and a SHA‑256 hash in an immutable audit log (e.g., CloudWatch Logs or Elasticsearch).
- Execute the snippet in a sandbox – Docker or Firecracker micro‑VMs are cheap and give you isolation.
- Run automated tests against the generated code before merging.
Minimal Python example
import os, hashlib, json, subprocess, uuid
import httpx
ANTHROPIC_API_KEY = os.getenv("ANTHROPIC_API_KEY")
API_URL = "https://api.anthropic.com/v1/messages"
def generate_code(prompt: str) -> str:
payload = {
"model": "claude-3-sonnet-20240229",
"max_tokens": 1024,
"messages": [{"role": "user", "content": prompt}],
}
headers = {
"x-api-key": ANTHROPIC_API_KEY,
"anthropic-version": "2023-06-01",
"content-type": "application/json",
}
resp = httpx.post(API_URL, json=payload, headers=headers, timeout=30)
resp.raise_for_status()
return resp.json()["content"][0]["text"]
def audit_log(entry: dict):
# In real life, push to a log store; here we just print JSON.
print(json.dumps(entry))
def run_in_sandbox(code: str) -> subprocess.CompletedProcess:
# Write code to a temporary file inside a Docker container.
uid = uuid.uuid4().hex[:8]
src_path = f"/tmp/gen_{uid}.py"
with open(src_path, "w") as f:
f.write(code)
# Run a one‑off container with limited resources.
cmd = [
"docker", "run", "--rm",
"-v", f"{src_path}:/app/script.py",
"python:3.11-slim",
"python", "/app/script.py"
]
return subprocess.run(cmd, capture_output=True, text=True, timeout=20)
# Example usage
if __name__ == "__main__":
user_prompt = (
"Write a Python function that takes a Pandas DataFrame of trades and returns the VWAP. "
"Include type hints and a docstring."
)
generated = generate_code(user_prompt)
entry = {
"id": uuid.uuid4().hex,
"prompt": user_prompt,
"code_hash": hashlib.sha256(generated.encode()).hexdigest(),
"code": generated,
}
audit_log(entry)
result = run_in_sandbox(generated)
print("--- Sandbox stdout ---")
print(result.stdout)
print("--- Sandbox stderr ---")
print(result.stderr)
What the snippet does:
- Calls Claude 3‑Sonnet for a code snippet.
- Logs the request/response pair with a hash for later traceability.
- Executes the code inside a throw‑away Docker container, preventing any accidental access to host resources.
- Prints the output, which you can then feed into your CI pipeline for further validation.
Deploying at scale
-
Kubernetes – Wrap the above logic in a micro‑service and expose it via a gRPC endpoint. Use a
JoborCronJobto spin up a pod per request, ensuring isolation. - Observability – Push the audit JSON to a Loki stack or OpenTelemetry collector; Grafana dashboards can surface request latency, error rates, and compliance metrics.
- Policy enforcement – Gate the service behind an OPA (Open Policy Agent) rule that checks the model version and enforces a maximum token budget.
4. My take
From an AI‑infrastructure standpoint, Goldman’s retreat is a wake‑up call rather than a verdict on LLM coding assistants. The technology works; the problem is how we integrate it safely.
In the past year I’ve built a few internal “AI‑Copilot” pipelines for Griffin AI Tech. The pattern that survived the toughest audits was “LLM‑as‑a‑service + sandbox + immutable audit log". It gives developers the productivity boost of Claude Code while keeping security teams happy.
If you’re considering rolling out a similar tool, start small:
- Pick a low‑risk domain (e.g., generating unit‑test scaffolding).
- Enforce strict versioning of the model and retain every prompt/response pair.
- Automate the sandbox step from day one.
When those pieces are in place, you can gradually expand to more critical workloads—data‑pipeline glue code, infrastructure‑as‑code snippets, or even auto‑generated Helm charts.
The bottom line: LLMs are powerful, but they are not a silver bullet for production code. Treat them like any third‑party library—pin versions, run static analysis, and audit every change. Do that, and you’ll reap the efficiency gains without the compliance headaches that forced Goldman to pull the plug.
If you liked this post, give it a 👍, share it with your team, or drop a comment about how you’re sandboxing AI‑generated code in your stack.
Top comments (0)