Letting AI Agents Into Your Website Repo: A Security Checklist
What a CTO should check before an AI agent gets access to the marketing site’s repo: permissions, branch protection, secrets, previews and audit trails.
Key takeaways
- Give the agent access to one repository, never the whole organization.
- Keep branch protection on: the agent opens pull requests and a person merges them.
- Keep production secrets away from the agent. Previews run with preview-only keys.
- Every change should leave a trail: who asked, what changed and who approved it.
- Make sure you can revoke access in one click.
On this page
Marketing wants AI agents to ship website changes. The CTO’s first question is fair: what can this thing touch? A website repo often sits next to product code, shares CI secrets and deploys to the company’s domain.
The short answer: an agent should work like a new contractor on their first day. Access to one repository, changes through pull requests only, no production secrets, and a record of everything it does.
Scope access to one repository
Install the agent as a GitHub App limited to the marketing site’s repository. Avoid personal access tokens and organization-wide installs. If the marketing site lives in a monorepo with product code, consider moving it out first. It is the cleanest security boundary you can draw.
Keep branch protection and required reviews
Protect the main branch: require a pull request, at least one approving review and passing checks. With that in place, the agent can propose anything and merge nothing. Your existing CI (build, lint, tests) runs on its pull requests like on anyone else’s.
Keep secrets out of reach
The agent doesn’t need production API keys to change a landing page. Make sure:
- Repository and CI secrets aren’t exposed to pull requests from the agent’s branches.
- Preview deployments use preview-only keys and test data.
- Environment files with real credentials aren’t committed to the repo at all.
Review every change in a preview
Each pull request should build a preview deployment. Reviewers check the actual page, on desktop and mobile, before approving. Reviewing a diff alone isn’t enough for visual changes.
Keep an audit trail
You should be able to answer three questions for any change on the live site: who asked for it, what changed and who approved it. Pull requests answer the last two. Make sure the agent links each one to the request that started it.
The checklist
- GitHub App installed on one repository only.
- Branch protection on main, with required reviews and checks.
- No production secrets available to agent branches or previews.
- A preview deployment on every pull request.
- Every change traceable to a request and an approver.
- A written answer on where code is processed and stored.
- Access you can revoke in one click.
If a vendor can’t tick all seven, keep it away from your repo. For the bigger picture, read what an AI website agent is. Centipage is built around this list: one repo, pull requests only, and nothing merges without approval. See how it works.
Frequently asked questions
Can an AI agent push directly to main?
Only if you let it. With branch protection and required reviews on the main branch, an agent can only open pull requests, and a person with merge rights decides what goes live.
What GitHub permissions does a website agent need?
Read and write access to the contents and pull requests of the one repository it works on, and read access to checks so it can see whether the build passed. It doesn’t need admin rights or access to other repositories.
What happens to our code?
Ask the vendor directly: where code is processed, whether it’s stored, and whether it’s used to train models. Get the answers in writing, in the data processing agreement.
Keep reading
All resources-
What Is an AI Website Agent? A Plain-English Guide
An AI website agent finds what to improve on your site, makes the change and asks for approval. What they can do today, and where people stay in charge.
-
AI Search Optimization: How to Get Cited by ChatGPT and Perplexity
What AI search engines look for when they pick sources, and the practical changes that make a SaaS website more likely to be cited in their answers.
-
Core Web Vitals for Marketers: What to Fix First
LCP, INP and CLS in plain words: what each one measures, the thresholds Google uses, and the fixes that usually move a marketing site from red to green.
Your website, 1% better every day.
Centipage’s agents find what to improve on your site, make the change and wait for your approval before it goes live.