The following plugin provides functionality available through
Pipeline-compatible steps. Read more about how to integrate steps into your
Pipeline in the
Steps
section of the
Pipeline Syntax
page.
For a list of other such plugins, see the
Pipeline Steps Reference
page.
AI Agent
aiAgent: Run AI Agent
agent (optional)
Nested Choice of Objects
claudeCode
codex
customConfigEnabled : boolean (optional)
When enabled, the plugin writes a build-scoped ~/.codex/config.toml from the configured content. This is useful for per-build Codex settings and MCP configuration.
customConfigToml : String (optional)
TOML content equivalent to ~/.codex/config.toml. Stored in job configuration as plain text. Keep secrets in Jenkins credentials.
cursor
geminiCli
openCode
apiCredentialsId : String (optional)
Select a Secret Text credential containing the API key for this agent. The key is injected as the expected environment variable for the selected agent (for example: ANTHROPIC_API_KEY, OPENAI_API_KEY, CURSOR_API_KEY, GEMINI_API_KEY). If empty, the build uses credentials already present on the node.
apiEnvVarName : String (optional)
Override the environment variable name used to inject the API key credential. Leave empty to use the selected agent default. Useful when an agent supports multiple provider variable names.
approvalTimeoutSeconds : int (optional)
Maximum number of seconds to wait for an approval decision before the build is failed. Only used when Require manual approvals is enabled. The default is 300 seconds (5 minutes).
commandOverride : String (optional)
Overrides the built-in agent command with a single shell command or shell snippet. This runs via the platform shell, so use the Setup script field for multiline setup. Line breaks are normalized to spaces when the job configuration is saved.
environmentVariables : String (optional)
Extra environment variables in KEY=VALUE format, one per line. Lines starting with # are ignored. These values are stored in plain text in job configuration.
extraArgs : String (optional)
Additional command-line arguments appended to the default agent command. For example --max-budget-usd 5 or --effort high. Arguments are split on whitespace.
failOnAgentError : boolean (optional)
When checked, the Jenkins build is marked as failed if the agent process exits with a non-zero exit code. When unchecked, a non-zero exit code is logged but the build continues.
model : String (optional)
The model identifier to pass to the AI agent (for example claude-sonnet-4, o3, gemini-2.5-pro). Leave empty to use the agent's default model.
prompt : String (optional)
The text prompt sent to the AI agent. Supports multi-line input. Build parameters and environment variables can be referenced in the prompt when using a Command override.
requireApprovals : boolean (optional)
When enabled, the build pauses each time the agent requests a tool call (shell command, file edit, etc.) and waits for manual approval or denial through the Jenkins UI before continuing.
setupScript : String (optional)
Runs before the agent command and shares the same shell session, so exported variables flow into the agent process. This is currently supported on Unix agents only.
workingDirectory : String (optional)
Subdirectory relative to the workspace where the agent process runs. Leave empty to use the workspace root.
yoloMode : boolean (optional)
Skips all permission checks and approval prompts inside the agent, allowing it to execute tools (file edits, shell commands, etc.) without confirmation. Use with caution — the agent will have unrestricted access to the workspace.
Was this page helpful?
Please submit your feedback about this page through this
quick form.
Alternatively, if you don't wish to complete the quick form, you can simply
indicate if you found this page helpful?
See existing feedback here.