// troubleshooting guide · jenkins
Jenkins 'Scripts Not Permitted to Use Method' Error
- Status
- Workaround available
- platforms:
- Jenkins Pipeline
- updated:
- November 16, 2026
- reports:
- 4
- Method
- how we research
RUNBOOK · jenkins/scripts-not-permitted4 FIXES
// quick answer
The Groovy sandbox blocked a method in your pipeline. An admin approves the signature in Manage Jenkins > In-process Script Approval, or the code moves into a trusted shared library.
Most likely fix: Approve the signature
How to fix it
// try these in order, the most common fix is first
FIX 1Approve the signature
- 01As an admin go to Manage Jenkins > In-process Script Approval (or <jenkins URL>/scriptApproval/)
- 02Review the pending signature and click Approve only if it is safe
- 03Re-run the build; repeat for each new signature
Did this fix it?FIX 2Rethrow caught rejections
- 01If the method never appears on the approval page, check for try/catch blocks that swallow errors
- 02Catch org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException and rethrow it so it reaches the approval page
Did this fix it?FIX 3Use a trusted shared library
- 01Move the code into a global shared library configured in Manage Jenkins > System > Global Trusted Pipeline Libraries
- 02Trusted library code runs outside the sandbox, so no per-method approval is needed
Did this fix it?FIX 4Avoid the method
- 01Use a pipeline step instead (e.g. readJSON, readFile, sh) rather than raw Java APIs
- 02Update the Script Security plugin if an approved method keeps getting blocked
Did this fix it?
SANDBOX · jenkins RUNS IN YOUR BROWSER
Try it: push, review, run CI and merge in a code host and cloud workspace
A hands-on Jenkins-style sandbox, including the spots where users get stuck. See where problems like this one start. 1-2 minutes, nothing is saved.
Symptoms
The pipeline fails with org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use method ... (or staticMethod / new).
Why it happens
- C-01Pipeline code calls a Java/Groovy method not on the sandbox allowlist
- C-02The signature is pending but nobody approved it
- C-03The rejection was caught in a try/catch so it never reached the approval page
- C-04A Script Security plugin bug on older versions
// this guide also covers
- scripts not permitted to use method
- jenkins script approval
- rejectedaccessexception jenkins
- jenkins in-process script approval
Still not working?
If Jenkins keeps failing, you're not alone. See every Jenkins problem users report or the alternatives people switch to.
Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.
Talk to usThe same problem in other apps
Other Jenkins errors
- Jenkins Build Stuck 'Waiting for Next Available Executor'
- Jenkins Build Stuck and Won't Abort
- Jenkins Plugins Failed to Load After Update
- Jenkins Not Starting: 'Job for jenkins.service failed'
- Jenkins java.lang.OutOfMemoryError: Java Heap Space
- Why Is Jenkins So Slow?
- Jenkins GitHub Webhook Not Triggering Build
- Jenkins Git 'Failed to Connect to Repository' Status Code 128