How do you restrict which jobs can run on which agents?
AdvancedConceptCredentials & security
Answer
Labels plus EXCLUSIVE node mode prevent accidental placement, but a pipeline author can always request any label. To enforce it, use the Job Restrictions plugin or Authorize Project plugin with agent permissions (Agent/Build), so that only jobs in /payments/prod-deploy can run on the agent holding prod network access. With Kubernetes, enforce at the cluster level: deploy templates use service accounts that only exist in a restricted namespace.
More on Credentials & security
What credential types does Jenkins support out of the box?BeginnerWhat is the difference between Global and System credential scope?IntermediateHow do folder-scoped credentials help multi-team controllers?IntermediateHow does Jenkins mask secrets in logs and what are its limits?AdvancedWhat authorization strategies are available?IntermediateWhat are the key permissions to understand in matrix auth?Intermediate