Golden paths: what should an AI agent be allowed to change?
Templates are how we let an AI agent near our deployment files without letting it near the security settings. This is what is in them, and how far that protection actually goes.

Letting a language model write your Kubernetes manifests is a bad idea. Letting it fill in the port number in a manifest you already wrote is a different proposition, and the distance between those two is where this layer lives.
On the internal developer platform we built on OVHcloud in 2026, the templates hold everything the platform has already decided: a hardened Dockerfile per language, one pipeline, the manifests an application needs. This article covers what is in them, the annotations that mark which lines an agent may touch, and what those annotations do not do.
Part 5 of six. You don't need the other parts to follow this one.
What does the golden path contain?
The golden path defines how we prepare an application's build and deployment configuration. We organised it into three connected template groups.
| Template group | What it defines | Application-specific inputs |
|---|---|---|
| Dockerfiles | Build stages and runtime configuration | Language version, port, entry point or start command |
| GitLab CI | Analysis, image build and push, image-pull Secret creation | Build context, image name and target namespace |
| Kubernetes manifests | Workload, networking and GitOps configuration | Application name, ports, hostname and resource values |
The Dockerfile library covers Python, Node.js, Java with Maven, Spring Boot with Maven or Gradle, and Go.
Each template contains concrete implementation choices. Python separates dependency installation from the runtime stage. Node.js separates installation, building and runtime. The Go template compiles with CGO_ENABLED=0 and uses a scratch final image.
The agent is instructed to retrieve the matching templates and fill them in, rather than invent a new Dockerfile or pipeline for each application.
Guiding edits through annotations
Two comment markers distinguish platform configuration from application-specific values:
[AGENT-LOCK]identifies lines or blocks the agent is instructed to preserve.[AGENT-EDIT]identifies placeholders or sections it may adapt.
The agent instructions treat unmarked lines as locked by default.
The Python Dockerfile shows the distinction directly:
# [AGENT-LOCK]: Switch to non-root user. This line must always be present.
USER appuser
# [AGENT-EDIT]: Expose the port your application listens on.
# Replace <INSERT_PORT> with the actual port number (e.g., 8000, 5000).
EXPOSE <INSERT_PORT>
The runtime user is already chosen. The listening port comes from the application.
We use the same convention in the Kubernetes templates. Application names and resource values are editable; security-context settings and the structure of resource requests and limits are marked for preservation.
The editing rules sit beside the configuration they describe. A reviewer can compare the generated file with the template and see which changes were expected.
Connecting templates to the shared services
The CI template carries the connections from part 4. It specifies the runner tag, Harbor hostname and Harbor project, while leaving the build context, image name and target namespace as inputs.
It also defines the delivery sequence: SonarQube analysis, a Docker-in-Docker build and push, then image-pull Secret creation. The SonarQube job remains non-blocking through allow_failure: true.
Some values must match across templates. The deployment references an image-pull Secret named registry-credentials, and the orchestrator instructions require that name when filling the pipeline's Secret placeholder.
Image tagging shows the same pattern. The pipeline publishes a commit SHA tag and also updates latest. The deployment template expects the SHA tag: its image placeholder is marked for the full Harbor URI including the commit short SHA, and the orchestrator builds exactly that reference. A deployment therefore points at one immutable image rather than a moving tag. The latest tag stays published alongside it, which matters if anyone on your team treats it as the current release.
Defining Kubernetes defaults
The deployment template specifies a non-root security context, a read-only root filesystem, disabled privilege escalation and dropped Linux capabilities. CPU and memory values remain editable within a predefined requests-and-limits structure.
The accompanying documentation maps Small, Medium and Large resource tiers to values the agent can use during onboarding.
Networking has its own template. It declares default-deny ingress and egress policies, then adds allowances for traffic from the ingress-controller namespace and DNS traffic to kube-system. A separate rule permits ingress to ACME HTTP-01 solver pods.
Those rules describe a specific starting point. They do not include an application-specific allowance for an external database or API. The network policy is therefore part of what the developer needs to inspect when reviewing the proposed deployment.
What the annotations do not enforce
The annotations guide generation. They do not independently prevent the agent from changing a line.
We express the rules in template comments and agent instructions. They make the intended boundaries visible, but they are not an immutable editing mechanism or a validator that rejects every prohibited change.
The workflow includes a human review step. The agent prepares the Dockerfile, pipeline and application manifests on a branch, then presents a merge request for review and merging.
The agent is also instructed to remove the annotation comments before committing the generated files. That leaves files without the editing markers; it does not validate that the rules were followed.
The distinction is important: templates define the conventions, instructions guide the edits, and the merge request makes the resulting configuration reviewable.
From templates to the AI workflow
To examine the approach, start with a Dockerfile in the template library. Follow its editable values into the pipeline and deployment manifests, then compare the preserved sections with the agent instructions.
You can see what varies per application, what the platform has already defined and what reaches the reviewer.
In part 6, we follow the AI control plane that uses these templates, from repository analysis and requirements gathering through the merge request, pipeline and initial Argo CD bootstrap.
The environment we built this on is no longer running. The code is public, so you can read the architecture and the decisions behind it.
The full series
- AI platform engineering on OVHcloud: an internal developer platform experiment
- OVHcloud Managed Kubernetes with Terraform: from state to cluster
- Argo CD app of apps: from an empty cluster to platform services
- Harbor container registry and GitLab CI: from build to Kubernetes
- Golden paths: what should an AI agent be allowed to change?
- Google ADK agents for app onboarding: where human review fits



