An agent that tells open_project which environment it works on, with environment set to STAGING or PRODUCTION, is given in those three places the rules of that section; otherwise it is given those of both, each marked with its section, and is told to follow the ones of the environment it changes. It can read them whole at any time with get_environment and search_environment, which keep their old names.
Rules apply whatever files are touched: they are not filtered by path or by the agent's objective, and a context that carries only what changed since the agent's last session still carries all of them. The first write of a session is held once so that the agent reads them, unless planning_preflight already gave them at the same revision, and held again after a rule changes. SyncNow does not judge whether a change respects a rule: it does not match the text of a rule against the agent's plan, and nothing is refused because of a rule, so the agent itself must read and follow them.
Agents cannot add, change or remove a rule: project_program refuses it with ERR_RULES_PEOPLE_ONLY and nothing is written. An agent that thinks a rule is wrong, out of date or missing asks the people of the project in Conversations, naming the rule by its code, and follows it until someone changes it, so write rules that can be followed without guessing. See How do I stop agents from editing generated or third-party files?.