AI jobs

Give an AI review a safe workspace

An AI job receives approved source snapshots and dependency context through logical paths. It can inspect files, search text, fetch requested documentation, and write only declared output files.

Documentation home ยท Interactive AI guide

Configuration

jobs:
  review:
    type: ai
    needs:
      - verify
    sources:
      - name: current
        current: true
      - name: upstream
        repo: https://github.com/example/upstream.git
        ref: v2.4.1
    prompt: |
      Review /artifacts/verify/check/report.md.
      Compare it with /sources/upstream/ and write /output/review.md.
    model: GPT-5.6 Luna
    reasoning: High
    context_window: 328k
    data_policy: local-only
    artifacts:
      - path: /output/review.md
        visibility: exported
    limits:
      max_context_bytes: 262144
      max_artifact_bytes: 131072
      max_artifacts: 8
      max_turns: 8
      max_tokens: 16000
      max_duration: 5m
      max_network_requests: 8
FieldMeaning
typeMust be ai.
promptRequired provider instructions.
modelThe current adapter accepts GPT-5.6 Luna.
reasoninglow, medium, high, xhigh, or max.
context_windowThe current adapter accepts 328k.
data_policylocal-only or redacted-remote.
sourcesNamed current or Git source snapshots.
limitsContext, artifact, turn, token, duration, budget, and network caps.
artifactsDeclared logical output paths.

AI jobs cannot set image, working_dir, user, repo, ref, env, or script fields. Their filesystem access is read-only except for declared outputs.

Sources

Each source has a unique safe name. The name becomes part of its logical path.

sources:
  - name: current
    current: true

Use a shallow checkout at a branch or tag:

sources:
  - name: release
    repo: git@github.com:example/project.git
    ref: v3.2.0

Remote sources require both repo and ref. The reserved name current is valid only with current: true. A source checkout failure fails the AI job before the provider session starts.

The current source excludes Git internals, contd state, credentials, common credential files, SSH keys, dependency directories, virtual environments, .env files other than .env.example, and files ending in .pem or .key. A non-Git current directory still works, but has no Git revision metadata.

contd reuses local Git authentication while preparing a source. It does not put Git credentials or credential-bearing URLs in the workspace or prompt.

Logical workspace paths

/sources/<name>/
/artifacts/<stage>/<job>/...
/logs/<stage>/<job>/stdout.log
/logs/<stage>/<job>/stderr.log
/metadata/<stage>/<job>.json
/metadata/sources/<name>.json
/metadata/diffs/<source-name>.patch
/<declared-output>

These are workspace paths, not host paths. Sources, dependency inputs, logs, and metadata are read-only. Use the same absolute path in the prompt, write_output, and artifact declaration.

The roots /sources, /artifacts, /logs, and /metadata are protected. Dependency paths include stage and job names. The dependency closure includes direct and transitive dependencies.

Workspace tools

ToolUse
read_fileRead a UTF-8 text file. Individual reads are capped at 256 KiB.
list_pathsList immediate children of a logical directory.
search_textFind text and return matching paths and line numbers.
write_outputWrite one declared output file.
fetch_urlFetch explicitly requested HTTP or HTTPS documentation.

Shell commands, arbitrary filesystem writes, Git commands, deployment tools, and agent spawning are not available. fetch_url is limited to HTTP and HTTPS, the configured request count, and 256 KiB per response.

Outputs

artifacts:
  - path: /output/review.md
    visibility: exported

The prompt and write_output call must use the same logical path. Output paths cannot replace source files, dependency artifacts, logs, or metadata. Declared output content is capped by max_artifact_bytes when set.

If no output is declared, contd still saves the provider's structured AI report as an internal artifact. A successful AI job also saves the input manifest as an internal artifact.

Provider and limits

The current provider is the GitHub Copilot SDK. It uses the local logged-in GitHub CLI or Copilot account and keeps the provider session bound to the temporary workspace.

LimitDefault
max_context_bytes131072
max_artifact_bytes16384
max_artifacts4
max_turns1
max_tokens1000
max_network_requests8

Set max_duration to bound the provider call. Set max_budget when the provider reports a compatible usage budget. Provider usage is recorded when available, otherwise contd records unavailable.

Cleanup and provenance

contd deletes the temporary workspace after execution. It retains an input manifest with source names and revisions, dependency paths, checksums, sizes, unavailable inputs, output paths, and cleanup status. The manifest does not contain source contents or credentials.

The AI analysis artifact records provider settings, data policy, limits, prompt hash, input manifest reference, source metadata, response summary, evidence, next checks, confidence, and usage when available.

AI jobs after failures

Ordinary jobs are skipped when a dependency fails. AI jobs can run after a failed or timed-out dependency and receive that dependency's state, failure, logs, artifacts, metadata, and reproducibility information.