Skip to main content
PUT
Update repository guardrails

Authorizations

Authorization
string
header
required

Your Reason API key from Settings › API keys. New keys use reason_; legacy ara_ keys remain accepted. Keys are capability-scoped: run, mcp:read, mcp:write, secrets:read, secrets:write, sessions:read, sessions:debug, devices:read, devices:write, devices:use, computers:read, computers:write, ssh:write, knowledge:read, memory:read, memory:write, skills:read, skills:write, pages:read, pages:write, repos:read, repos:write, reviews:read, reviews:write, deployment:read, analytics:read, org:read, org:write, attachments:read, attachments:write, guardrails:read, guardrails:write, network:read, network:write, automations:read, automations:write, agent_auth:read. devices:write, devices:use, computers:read, computers:write, ssh:write, network:read and network:write are opt-in, excluded from default keys. computers:read lists visible cloud and connected computers without waking them or granting execution access. devices:read discovers local Device targets; devices:use separately consents to local execution, so a discover-and-run local workflow needs both. devices:write manages enrollment and device grants; computers:write creates or deletes cloud computers; ssh:write manages retained SSH access. network:read reads the saved workspace network policy; network:write replaces custom allowed hosts and requires a current organization owner/admin. Legacy project PATCH requests containing network_allowed_hosts also require network:write plus their existing run scope and project management permission; saved project hosts do not affect current session egress. Only owners/admins can mint or manage keys with network:write; keys cannot grant themselves more authority. See /docs/network-policies for replacement semantics and runtime applicability. mcp:write manages MCP server configuration only; it does not authorize remote MCP-tool execution. sessions:read reads sessions, including the assistant, reasoning and tool activity in their events. sessions:debug is privileged: only for organization owners/admins, it expands session events to the full diagnostic projection (diagnostic event kinds, status text and raw event metadata).

Scopes

guardrails:write

Path Parameters

orgId
string
required

Organization id or slug. Resolve it with GET /v3/self.

owner
string
required

Repository owner (user or organization): the part before the slash of a full_name that listRepositories returns.

repo
string
required

Repository name: the part after the slash of a full_name that listRepositories returns.

Query Parameters

provider
enum<string>
default:github

Source-control host of the owner/repo path. Sending it also adds provider to the response and reports repo in GitHub's spelling; omitted, the response has no provider and echoes repo as requested.

Available options:
github

Body

application/json

A repository's automation guardrails. In a response, its effective values: stored ones, with defaults for any never set. In an update, every property is optional and only the fields sent change.

auto_fix_new_issues
boolean

Whether to open a fix run automatically when a new issue is filed.

auto_audit_on_connect
boolean

Whether connecting the repository starts an initial codebase audit and sets up a daily audit.

pr_risk_assessment
boolean

Legacy PR Merge Bot switch, kept in lockstep with the bot enabled state; disabling it stops risk reports and unattended merges.

auto_merge_prs
boolean

Allow PR Merge Bot to assess and squash-merge verified pull requests when its risk threshold and all enabled requirements pass.

auto_merge_max_risk
enum<string>

Highest assessed risk PR Merge Bot may accept for an unattended merge; other enabled requirements still apply.

Available options:
zero,
low,
medium,
high
auto_merge_require_no_blocking_findings
boolean

Require no unresolved review-bot findings at or above the accepted risk threshold before an unattended merge.

auto_merge_require_reason_authored
boolean

Require a Reason-authored pull request before an unattended merge.

auto_merge_require_ci_green
boolean

Require passing CI and GitHub checks before an unattended merge.

auto_merge_require_reason_verify
boolean

Require Reason's verification checkpoint to hold before an unattended merge.

auto_merge_require_migration_approval
boolean

Require standing human approval when changed files match the configured protected paths.

auto_merge_require_ara_authored
boolean
deprecated

Deprecated: use auto_merge_require_reason_authored. Accepted on update (sending both with different values is rejected) and returned with the same value.

auto_merge_require_ara_verify
boolean
deprecated

Deprecated: use auto_merge_require_reason_verify. Accepted on update (sending both with different values is rejected) and returned with the same value.

auto_merge_review_context
enum<string>

Which automated review-bot comments PR Merge Bot reads. ara_review_bot_only is a deprecated spelling of reason_review_bot_only, still accepted on update; responses report reason_review_bot_only.

Available options:
all_review_bots,
reason_review_bot_only,
ara_review_bot_only
auto_merge_custom_prompt
string

Additional trusted approval criteria appended to this repository's PR Merge Bot risk prompt.

auto_merge_protected_paths
string

Newline-separated glob patterns; changes touching a matching path require a standing human approval before an unattended merge. Lines starting with # are comments.

auto_merge_max_changed_lines
integer

Maximum total changed lines (additions plus deletions) an unattended merge may carry. 0 disables the limit.

Required range: x >= 0
auto_merge_delete_branch
boolean

Delete the source branch after an unattended merge. Fork branches and branches other open pull requests target are never deleted.

autofix_prs
boolean

Fix failing CI on pull requests agents open: when a check on one fails or times out, Reason sends an automatic follow-up to fix its branch, by default at most one attempt per pull request. It continues the Session that opened the pull request while that Session is open, otherwise it runs in its own Automation Session. Reviews do not trigger it. Reason may post comments and push commits.

browser_enabled
boolean

Experimental: let agents drive a headless browser in the sandbox for this repository. Off by default; the browser has network access on the machine that holds repository credentials.

allow_install_scripts
boolean

Let package-manager installs in the sandbox run lifecycle scripts (preinstall, postinstall). Off by default, so repository content cannot run code at install time.

Response

The updated repository guardrails.

repo
string
required

The repository in owner/name form; GitHub's spelling when provider was sent, otherwise as requested.

guardrails
object
required

A repository's automation guardrails. In a response, its effective values: stored ones, with defaults for any never set. In an update, every property is optional and only the fields sent change.

provider
enum<string>

Present only when the request named a provider.

Available options:
github