Three points in a piece of software's life are covered: writing it in the editor, building it in the pipeline, and the repository it lives in afterwards. Dependencies, secrets and code quality are checked at all three by the same policy.
AI agents write code by reading what is in the project. What actually reaches them is decided by a rule per path, not by the agents themselves. They can still work, and what is not meant for them does not arrive.