Ubuntu c0d758249c security: split internal/edge access, harden sandbox, fix follow-up matching
- server: two listeners — :4646 internal (PROXY_INTERNAL_TOKEN only,
  X-Authentik-Username no longer trusted) and :4647 edge (Authentik
  outpost only; requires X-Authentik-Username; NetworkPolicy-restricted)
- session-manager: strip PROXY_INTERNAL_TOKEN & friends from the ACP
  child env (allowlist + proxy vars), dedicated agent HOME, resolved
  tool_call tracking so findSessionForFollowUp ignores already-answered
  results (no more cross-turn log spam / stale matches)
- ask_question auto-answer picks the SAFE option (deny/reject/last),
  never options[0] — root cause of the allow-all config drift
- bootstrap: force-rewrite deny-all cli-config on every boot into BOTH
  proxy and agent HOME (PVC drift self-heals), strip agent-authored hooks
- cli-config: deny all 22 built-in tools (Shell/Read/Write/Grep/Glob/
  WebFetch/WebSearch/Task/...), allow Mcp(*) only
- deploy: edge Service + ServiceExport, NetworkPolicy (4646 open+token,
  4647 only from node2 pod CIDR), readOnlyRootFilesystem, no SA token,
  agent-home + tmp emptyDirs
- Dockerfile: pin cursor-agent 2026.10.22-27dcf5f from build cache (deny
  enforcement verified), non-root, dedicated agent home
- e2e: auth-surface matrix + built-in Read leak check + bridge egress

Closes infra-yip
2026-10-23 10:11:39 +00:00

cursor-agent-api-proxy

OpenAI-compatible HTTP API wrapping cursor-agent via ACP (agent acp). Deployed on node4-k3s.

  • Image: dcr.trinitysan.by/infra/cursor-agent-api-proxy
  • Deploy: deploy/ (PVC, Deployment, Service, ServiceExport)
  • Flux image automation: flux/ (ImageRepository / ImagePolicy / ImageUpdateAutomation)

Infra on node4 keeps thin Flux glue (Namespace, SecretAdapters, GitRepository, Kustomizations) in infrastructure/node4-k3s/131-cursor-agent-api.yaml. Public HTTPS + Authentik live on node2 (245-authentik-cursor-agent-api).

Access

Endpoint Detail
Public https://cursor-api.trinitysan.by (Authentik outpost on node2)
In-cluster / MCS cursor-agent-api.cursor-agent-api.svc.clusterset.local:4646
Health GET /health

CI

Gitea Actions (.gitea/workflows/build-and-push.yaml) on master and workflow_dispatch pushes:

Tag Purpose
:latest Convenience
:<git-sha> Immutable full SHA
:<run_number>-<git-sha> Sortable; elected by Flux ImagePolicy

Repo secrets (required): DCR_USERNAME, DCR_PASSWORD. Onboarding contract: infra docs/how-to/onboard-repo-into-deployment-infra.md.

Local build / E2E

docker build -t cursor-agent-api-proxy:latest .
# Requires CURSOR_API_KEY in env or .env
./scripts/e2e-docker.sh

Flux update flow

  1. CI pushes run_number-sha to DCR
  2. ImageRepository scans; ImagePolicy picks highest run_number
  3. ImageUpdateAutomation commits the new tag into deploy/010-cursor-agent-api.yaml
  4. Kustomization applies; Deployment rolls

Requires a Gitea PAT with read+write on this repo (GITEA_CURSOR_AGENT_API_GITOPS_TOKEN on node4, see infra 060-external-secrets.yaml.template).

S
Description
No description provided
Readme
94 KiB
Languages
JavaScript 86.2%
Shell 11%
Dockerfile 2.8%