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.

Table of Contents

AI Agent

aiAgent: Run AI Agent

  • agent (optional)
      Nested Choice of Objects
    • antigravity
      • claudeCode
        • codex
          • additionalExecArgs : String (optional)
            Extra arguments inserted after codex exec --json --skip-git-repo-check and before the prompt. Use this for exec flags such as --ephemeral, --ignore-user-config, --ignore-rules, --add-dir path, --output-schema schema.json, or --color never. Arguments are split on whitespace.
          • additionalGlobalArgs : String (optional)
            Extra arguments inserted after codex and before exec. Use this for global Codex flags such as --search, --profile ci, -c key=value, --enable feature, or --image path.png. Arguments are split on whitespace. Keep secrets in Jenkins credentials or config, not here.
          • 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
            • grok
              • 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, XAI_API_KEY). If empty, the build uses credentials already present on the node. Antigravity CLI uses node-level Google authentication by default and has no default API key environment variable. Authenticate the Jenkins service account before running a job.
              • 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 600 seconds (10 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.
              • disableInteractive : boolean (optional)
              • 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.
              • executablePath : String (optional)
                Overrides only the executable in the generated agent command while preserving its arguments. Use an absolute path or a Jenkins environment variable, such as $HOME/.local/bin/codex. When empty, Jenkins resolves the default executable from the build node PATH. Interactive shell startup files are not loaded. Command override takes precedence over this setting.
              • 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. During ACP approval runs, the handler may reposition or ignore arguments that are incompatible with ACP or manual approvals.
              • 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, gpt-5.5, gemini-2.5-pro, grok-4.5). For Codex, Claude Code, and OpenCode, append a recognized reasoning effort with a colon, such as gpt-5.6-sol:xhigh. Antigravity CLI and Grok Build accept low, medium, and high, such as grok-4.5:high. Other colon suffixes remain part of the model identifier. Use a double colon to keep a recognized suffix literal, such as provider/model::high for model provider/model:high. The separate Reasoning effort field overrides the shorthand. 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.
              • reasoningEffort : String (optional)
                Optional reasoning effort for agents that support it. Codex maps this to model_reasoning_effort, Claude Code maps it to --effort, OpenCode maps it to --variant, and Antigravity CLI maps it to --effort. Grok Build maps it to --reasoning-effort. Common values include low, medium, high, xhigh, and max. Codex also supports ultra on compatible models, OpenCode supports minimal, and Antigravity CLI and Grok Build currently accept low, medium, and high. You can instead append a recognized value to the model, such as gpt-5.6-sol:xhigh. This field takes precedence over that shorthand. Unsupported agents ignore this field.
              • requireApprovals : boolean (optional)
                Supported for OpenCode and Grok Build. The build pauses when the agent requests tool permission and waits for approval or denial through the Jenkins UI before continuing. Other built-in agents and command overrides reject this setting before launch.
              • setupScript : String (optional)
                Runs before the agent command and shares the same shell session, so exported variables flow into the agent process. Without a shebang, Jenkins uses /bin/sh -e, so use POSIX syntax such as . file. Add #!/bin/bash or #!/bin/zsh before using shell-specific syntax such as source. 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.