Profile reference
Every key a profile can have, in the order they usually appear. For a complete example and how the file is found and validated, read The profile first.
Top-level keys
The top level is strict: a key that is not in this table is an error.
| Key | Type | Required | Default | What it is |
|---|---|---|---|---|
version | the number 1 | yes | — | Schema version of the file. |
company | slug | yes | — | A short name for the company. |
languages | object | no | { tickets: en, code: en } | Language of tickets and of code. |
trackers | list of entries | no | [] | Where tickets are read from. |
code | object | no | { hosts: [], groups: {}, deprioritise: [] } | Code hosts, repository groups, and the groups that rank lower. |
docs | list of entries | no | [] | Doc sources tickets link to. |
teams | list | no | [] | Who owns which projects and repositories. |
glossary | list | no | [] | Ticket words and their code-side words. |
conventions | list of strings | no | [] | Rules the skills quote to the agent. |
embeddings | one entry | no | { type: ollama, model: bge-m3 } | The embedder for code search. |
plugins | list of strings | no | [] | Extra plugin modules to load. |
tickets | mapping | no | { title_prefixes: {} } | How the company writes tickets: title_prefixes. |
tool_packs | list of entries | no | [] | Tool packs to load: each entry selects a tool-pack plugin by type. |
writes | mapping | no | off | Whether Safran may change anything outside this machine, and which kinds. See writes. |
me | mapping | no | — | Who "my work" means on this machine: name (the display name trackers and code hosts show) and accounts (the name one connector knows the person by, keyed by entry id). Without it Safran asks each tracker who its token belongs to. Not a secret, not used to sign in. |
work | mapping | no | every key has a default | How the work views (boards, iterations, ticket lists) read the trackers: boards.pinned, boards.include and boards.exclude (each <tracker id>:<board id>), working_days and stale_after_days (1 to 60 working days without an update before an in-progress ticket is shown as stale). |
harness | mapping | no | no projects | The job harness: which repositories an unattended coding agent may work in, what is run to check its work, and how the agent is started. |
A slug matches ^[a-z0-9][a-z0-9-]*$: lowercase letters, digits and dashes, not starting
with a dash.
version
Always 1. Any other value fails with version: Invalid input: expected 1.
company
A slug. It is shown by safran status and safran profile check, returned by the
get_company_profile tool, and handed to every plugin as context.
company: acmelanguages
| Field | Type | What it is |
|---|---|---|
tickets | 2-character string | ISO 639-1 code of the language tickets are written in. Skills write their output in it. |
code | 2-character string | ISO 639-1 code of the language of identifiers and comments. |
The schema checks the length only. When you write languages, write both fields: the default
applies to the whole object, not to each field.
languages:
tickets: tr
code: entrackers
A list of tracker entries. Every entry has these fields; the rest depend on type.
| Field | Type | Required | Default | What it is |
|---|---|---|---|---|
id | slug | yes | — | Your name for this tracker. Unique among trackers. Shown in output and used to say which tracker a reference belongs to. |
type | string | yes | — | The plugin that handles the entry: jira, azure-boards, linear, github-issues, or a type of your own plugin. |
projects | list of strings | no | [] | Project or team keys this tracker owns. |
token_expires | date (YYYY-MM-DD) | no | — | The day the entry's token stops working. See token_expires. |
projects does three jobs. It routes a ticket key to its tracker (PAY-1423 goes to the
tracker that lists PAY), it is the set of keys recognised in pull request titles, branch names
and descriptions when work history is built, and it is what teams[].projects is checked
against. Keys are compared without regard to case.
id: jira
type: jira
url: https://jira.acme.example
email_env: JIRA_EMAIL
token_env: JIRA_TOKEN
projects: [PAY, MOB, WEB]Type-specific fields: Jira, Azure Boards, Linear, GitHub Issues.
code.hosts
A list of code host entries. code itself is strict and has exactly three keys: hosts,
groups and deprioritise.
| Field | Type | Required | Default | What it is |
|---|---|---|---|---|
id | slug | yes | — | Your name for this host. Unique among code hosts. Also the directory name of its clones under the data directory. |
type | string | yes | — | azure-repos, github, gitlab, local, or a type of your own plugin. |
include | list of globs | no | [] | Keep only repositories whose name matches one of these. Empty means all. |
exclude | list of globs | no | [] | Drop repositories whose name matches one of these. Wins over include. |
token_expires | date (YYYY-MM-DD) | no | — | The day the entry's token stops working. See token_expires. |
id: azure
type: azure-repos
organization: acme
project: Platform
token_env: AZURE_DEVOPS_PAT
include: ["payments-*", "ledger", "web-app"]
exclude: ["*-archive"]How include and exclude match
*stands for any run of characters (including none),?for exactly one character. Everything else is literal. There are no character classes, no**, no negation.- A pattern must cover the whole name:
paymentsdoes not matchpayments-api;payments*does. - Matching ignores case.
- Each pattern is tried against the repository's short name (
payments-api) and against its host-qualified name (for exampleacme/Platform/payments-api); matching either is enough. excludeis applied first. A repository that matches anexcludepattern is dropped even if anincludepattern names it.
The filter is applied by Safran after the host lists its repositories, so it works the same
for every code host type, including your own plugins. safran repos shows what is left.
When two hosts list a repository with the same short name, the host that comes first in the
profile keeps the short name and the later one is named <hostId>/<name>.
Type-specific fields: Azure Repos, GitHub, GitLab, Local directories.
code.groups
A map from a group name to a list of repository names. A repository may sit in several groups.
Group names are free text; repository names are the short names safran repos prints.
code:
groups:
backend: [payments-api, ledger]
mobile: [acme-ios, acme-android]
frontend: [web-app, admin-panel]Groups scope a search: safran search "kısmi iade" --group backend, groups in the SDK, the
groups parameter of search_code. Several groups widen the scope; a group together with an
explicit repository list narrows it to the repositories in both. Naming a group the profile does
not define is an INVALID_INPUT error that lists the known groups.
The profile schema does not check that a repository named in a group exists on a code host: the hosts are not called during validation. A misspelled name simply never matches.
code.deprioritise
A list of group names whose code is kept for reference and should lose a tie: a legacy monolith,
an archived generation of an app. Hits in their repositories rank below comparable hits
elsewhere; they are never hidden. Every name must be a key of code.groups.
code:
groups:
backend: [payments-api, ledger]
legacy: [ledger]
deprioritise: [legacy]The score of such a hit is multiplied by DEFAULT_DEPRIORITISE_FACTOR (0.8) before the list is
sorted again. That factor has not been tuned with safran eval retrieval yet; with an empty
list ranking is untouched.
docs
A list of doc source entries: places tickets link to. Pages are fetched only when a ticket references them.
| Field | Type | Required | What it is |
|---|---|---|---|
id | slug | yes | Your name for this source. Unique among doc sources. |
type | string | yes | confluence, or a type of your own plugin. |
token_expires | date (YYYY-MM-DD) | no | The day the entry's token stops working. See token_expires. |
id: wiki
type: confluence
url: https://jira.acme.example
email_env: JIRA_EMAIL
token_env: CONFLUENCE_TOKEN
spaces: [PAY]Type-specific fields: Confluence.
teams
A list of teams. Entries are strict: only the fields below.
| Field | Type | Required | Default | What it is |
|---|---|---|---|---|
name | string | yes | — | The team's name. Unique among teams. |
projects | list of strings | no | [] | Tracker project keys the team owns. |
repos | list of strings | no | [] | Repository names the team owns. |
confidence | low, medium or high | no | — | Set by discovery when the mapping was inferred. low must be confirmed by a person. |
source | string | no | — | Where the mapping came from, for example 9 ticket-PR links. |
teams:
- name: Payments
projects: [PAY]
repos: [payments-api, ledger]
- name: Mobile
projects: [MOB]
repos: [acme-ios, acme-android]
confidence: low
source: 9 ticket-PR linksconfidence and source are written by safran discover. safran profile check and
safran owns flag every team with confidence: low until you check the entry and delete the
line. How teams answer ownership questions is on
Glossary, teams and conventions.
glossary
A list of entries. Entries are strict.
| Field | Type | Required | What it is |
|---|---|---|---|
term | string | yes | The word as people write it in tickets. |
code | list of strings, at least one | yes | Identifiers and words the code uses for it. |
note | string | no | A remark for people and for the agent. |
glossary:
- term: İade
code: [refund, chargeback]
note: Partial refunds are "kısmi iade".Two terms that are equal after case folding (İade and IADE) count as the same term and are
rejected as a duplicate. Matching and expansion are described on
Glossary, teams and conventions.
conventions
A list of non-empty strings. Safran does not interpret them: the get_company_profile tool
returns them, and the skills apply them to what they write.
conventions:
- Task titles are written in English.
- Branch names follow feature/<TICKET-KEY>-short-description.embeddings
One entry (not a list) with a type; the other fields depend on the type.
type: ollama
model: bge-m3When the key is missing, this exact entry is used. Type-specific fields: Ollama, OpenAI-compatible.
plugins
A list of module specifiers: package names, or paths relative to the profile file. Each module is imported, and every export that is a Safran plugin (or an exported list of them) is registered next to the built-in ones. A module that exports no plugin, or a type that is already registered, is an error.
plugins:
- ./plugins/acme-tracker.tsImporting a module runs its code. The CLI therefore loads plugins: only from a profile you
named (--profile, SAFRAN_PROFILE) or when you pass --allow-plugins; see
Validation errors.
Writing plugins shows how to write one.
tickets
How the company writes tickets, where a tool needs to know it. Strict, with one key today.
| Field | Type | Default | What it is |
|---|---|---|---|
title_prefixes | map from a side (slug) to a list of prefixes | {} | Title prefixes that say which side of a feature a ticket is. |
tickets:
title_prefixes:
backend: ["[BE]", "BE:"]
mobile: ["[iOS]", "[AND]"]Two tickets whose titles are equal once the prefix is removed, with prefixes of different
sides, are counterparts: [BE] Kısmi iade tutarı yuvarlanıyor and
[iOS] Kısmi iade tutarı yuvarlanıyor. The linked-work digest (safran ticket --linked,
get_linked_work, safran.tickets.linkedWork) then shows the backend ticket next to the
mobile one although nobody linked them. Matching ignores case and surrounding spaces. Each
side needs at least one prefix; a prefix is 1 to 40 characters. Empty: no counterpart detection.
tool_packs
A list of tool pack entries. A tool pack is a plugin of kind tool-pack that adds agent tools
to the MCP server; see tool packs.
| Field | Type | Required | What it is |
|---|---|---|---|
id | slug | yes | Your name for this pack. Unique among tool packs. It also names the pack's store namespace, so renaming it orphans what the pack stored. |
type | string | yes | The tool-pack plugin that handles the entry. No pack is built in: the type comes from a module listed under plugins. |
plugins:
- ./plugins/review-notes.ts
tool_packs:
- id: review-notes
type: review-notesLike a connector entry, the rest of the entry belongs to the plugin and is validated by its
own schema. safran plugins lists the tools of every configured pack.
writes
Changing things outside this machine. Off unless the profile turns it on, and then only for the kinds it lists. The section is strict.
| Field | Type | Default | What it is |
|---|---|---|---|
enabled | boolean | false | Master switch. While false no write is possible and the MCP server registers no write tool. |
allow | list of write kinds | [] | Which kinds are permitted: ticket.comment, ticket.create_child, pull_request.comment, pull_request.reply. Empty permits none, also with enabled: true. |
require_confirmation | boolean | true | true: every write is two calls, a preview and a commit that presents the preview's token. false additionally lets code call safran.writes.execute in one step. The MCP tools always use the two-step form. |
marker | single line, at most 200 characters | "" | A line appended to every body Safran posts, after an empty line, so readers can tell drafted text from typed text. Empty adds nothing. The preview shows the body with the marker already on it. |
version: 1
company: acme
languages:
tickets: tr
code: en
trackers:
- id: jira
type: jira
url: https://jira.acme.example
email_env: JIRA_EMAIL
token_env: JIRA_TOKEN
token_expires: 2027-03-31
projects: [PAY, MOB, WEB]
writes:
enabled: true
allow: [ticket.comment, pull_request.reply]
marker: Bir yapay zekâ asistanıyla hazırlandı.Turning writes on never grants more than what allow spells out, and the profile is only one
of the switches. A profile the CLI found by itself in the working directory has its writes
section ignored until you pass --allow-writes or name the profile; an SDK caller can pass
allowWrites: false; safran mcp --no-writes serves no write tool whatever the profile says.
The model step by step, and what it does not protect against, is on
writes. safran writes status prints which switch decided.
harness
The job harness: which repositories an unattended coding agent may
work in, what is run to check its work, and how the agent is started. Without projects there
is no harness. Nothing here is a secret, and nothing here lets a job change anything outside
this machine: a job ends as a local branch and a drafted pull request text. The section and
every mapping in it are strict.
version: 1
company: acme
harness:
agent:
permission_mode: acceptEdits
allowed_tools: ["Bash(bun run:*)", "Bash(bun test:*)"]
projects:
- name: payments-api
tickets: [PAY]
setup: [[bun, install]]
gates:
- { name: lint, command: [bun, run, lint] }
- { name: test, command: [bun, run, test], timeout_seconds: 600 }safran harness project <repo> writes a project entry from what it reads in the repository.
| Field | Type | Default | What it is |
|---|---|---|---|
agent | mapping | see below | How the agent is started. |
concurrency | integer, 1 to 32 | 1 | Jobs worked on at the same time, over all projects. |
max_attempts | integer, 1 to 10 | 1 | Fresh sessions a job may use before it is handed to a person as failed. |
max_fix_rounds | integer, 0 to 10 | 2 | Times one session is sent back with what the checks or the review found. |
branch_template | string, 1 to 200 characters | feature/{keys} | The branch of a job made from tickets. Must contain {keys}: the ticket keys in lower case, joined by -. |
projects | list | [] | The repositories jobs may work in. |
harness.agent
| Field | Type | Default | What it is |
|---|---|---|---|
agent.type | claude-code | claude-code | Which driver starts the agent. One is built in. |
agent.command | list of strings, at least one | [claude] | The program, as a list of words. No shell reads it. |
agent.model | string | — | Model of the work sessions. Without it the agent's own default applies. |
agent.review_model | string | agent.model | Model of the independent review. |
agent.effort | low, medium, high, xhigh or max | — | Passed to the agent. |
agent.permission_mode | default, acceptEdits, bypassPermissions or plan | acceptEdits | How the agent's permission prompts are answered. Nobody is there to answer them: under every mode but bypassPermissions the agent may run only what is allowed by name; bypassPermissions lets it run anything the guard does not refuse. The guard is a text filter, not a sandbox: read Permissions before choosing it. |
agent.allowed_tools | list of strings | [] | Tool patterns allowed without a prompt, in the agent's own syntax: Bash(bun test:*). A session may always run its project's gates and git's views of the worktree on top of this list. |
agent.mcp_config | string | — | An MCP configuration file for the agent. Without it the agent gets no MCP server. |
agent.max_budget_usd | number above 0, at most 10000 | — | Budget of one session, in US dollars. |
agent.timeout_minutes | integer, 1 to 1440 | 60 | Timeout of one session. |
agent.strip_env | list of environment variable names | [] | Removed from the environment before the agent, setup or a gate starts, on top of every *_env variable the profile names. |
harness.projects[]
| Field | Type | Default | What it is |
|---|---|---|---|
projects[].name | slug | required | The project's name. Unique among the projects. |
projects[].repo | string | the project's name | The repository as safran repos names it. |
projects[].checkout | absolute path | — | A checkout to branch from instead of the one Safran manages. The checkout itself is never edited: every job works in a worktree of its own. |
projects[].base | string | the repository's default branch | The ref a job branches from, for example origin/main. |
projects[].tickets | list of strings | [] | Tracker project keys whose tickets belong here, so safran harness add PAY-1423 needs no --project. |
projects[].setup | list of commands | [] | Run once in a new worktree before the agent starts (installing dependencies). Each command is a list of words. |
projects[].gates | list | [] | The commands the harness itself runs in a job's worktree after the agent says it is done. See below. |
projects[].context | list of strings | [] | Files, relative to the repository root, the agent is told to read first. |
projects[].notes | string, at most 4000 characters | empty | Free text appended to the agent's instructions for this project. |
projects[].max_parallel | integer, 1 to 32 | 1 | Jobs of this project worked on at the same time. |
projects[].commit_exclude | list of globs | [] | Paths that are never staged: local settings a job may touch but must not deliver. |
projects[].secret_files | list of globs | [] | Paths the agent may neither read nor write, on top of .env files. |
projects[].rules | list | [] | The project's own rules for the diff audit. See below. |
projects[].builtin_rules | boolean | true | The built-in diff rules: focused or skipped tests, silenced type checks, deleted tests. |
projects[].review | boolean | true | false skips the independent review. The gates and the evidence check still run. |
projects[].deliver | commit or staged | commit | commit: one commit on the job's branch. staged: the changes are left staged for the person. |
projects[].commit_message | string, 1 to 300 characters | {summary} | The commit message. Placeholders: {summary}, {title}, {keys}, {branch}, {id}. |
gates[] and rules[] of a project
| Field | Type | Default | What it is |
|---|---|---|---|
gates[].name | slug | required | Unique among the project's gates. |
gates[].command | list of strings, at least one | required | The program and its arguments. Exit 0 passes. |
gates[].timeout_seconds | integer, 1 to 86400 | 900 | A gate that runs longer is sent back to the agent as a timeout. |
gates[].fail_pattern | regular expression | — | How the names of failing tests are read from the gate's output: the first group is one name. Only used together with known_failures. |
gates[].known_failures | list of strings | [] | Tests that already fail on the base branch. A gate whose every failure is listed here passes. |
rules[].name | slug | required | Unique among the project's rules. |
rules[].level | block or warn | block | block sends the job back to the agent; warn is shown to the reviewer and to the person approving. |
rules[].message | string, 1 to 500 characters | required | The sentence the agent and the person read. |
rules[].added | regular expression | — | Fires when an added line matches. |
rules[].new_file | regular expression | — | Fires when the path of a new file matches. |
rules[].files | list of globs | [] | Limits the rule to files whose path matches one of these. Empty: every file. |
A rule needs added or new_file (the message is give `added` or `new_file` ). A regular expression that
does not compile is refused, as is a checkout that is not absolute
(harness.projects.0.checkout: must be an absolute path).
setup, gates and agent.command run as programs on this machine. As with plugins, a
profile that was only found in the current directory does not get them executed: name the
profile or pass --allow-plugins.
token_expires
Every tracker, code host and doc source entry also takes token_expires: the day
(YYYY-MM-DD) the entry's token stops working, when the person who made it knows.
id: azure
type: azure-repos
organization: acme
project: Platform
token_env: AZURE_DEVOPS_PAT
token_expires: 2027-01-15It is not a secret and is never used for authentication. Safran only warns: from
DEFAULT_TOKEN_EXPIRY_WARNING_DAYS (14) days before the date, safran doctor, the
get_server_info tool and the dashboard's Status screen name the entry and the days left, and
createSafran logs a warning. An expired token otherwise shows up as every tool failing at
once. The token is counted as working through the end of that day (UTC).
Rules that span entries
These are checked by the profile schema after the individual fields. The messages are the real ones.
| Rule | Message |
|---|---|
| Tracker ids are unique | trackers: duplicate tracker id "jira" |
| Code host ids are unique | code.hosts: duplicate code host id "azure" |
| Doc source ids are unique | docs: duplicate doc source id "wiki" |
| Team names are unique | teams: duplicate team name "Payments" |
| Glossary terms are unique after case folding | glossary: duplicate glossary term "IADE" |
| Tool pack ids are unique | tool_packs: duplicate tool pack id "review-notes" |
| A deprioritised group exists | code.deprioritise.0: "legacy" is not a group under code.groups |
| A title prefix sits under one side only (case ignored) | tickets.title_prefixes.mobile.0: prefix "[be]" is also listed under "backend" |
| A title prefix is listed once | tickets.title_prefixes.backend.1: prefix "[be]" is listed twice |
| A write kind is listed once | writes.allow: lists a write kind more than once |
| A project key is listed under one tracker only (case ignored) | trackers.1.projects: project "pay" is also listed under tracker "jira"; a ticket key must map to one tracker |
| A team's project is listed under some tracker | teams.0.projects: project "WEB" is not listed under any tracker |
| Harness project names are unique | harness.projects: duplicate project name "payments-api" |
| Gate names are unique within a harness project | harness.projects.0.gates: duplicate gate name "test" |
| Rule names are unique within a harness project | harness.projects.0.rules: duplicate rule name "no-console" |
A gate with known_failures has a fail_pattern | harness.projects.0.gates.0.known_failures: needs `fail_pattern`: without it the failing tests cannot be read from the output |
| A tracker project key is listed under one harness project only (case ignored) | harness.projects.1.tickets: "pay" is also listed under project "payments-api"; a ticket key must map to one project |
The last rule is only applied when at least one tracker lists a project. A profile with teams and no tracker projects yet is accepted.
Ids are unique per kind, not across kinds: a tracker and a doc source may both be called
atlassian.
The schema as written
This is the schema from the source. TrackerEntry, CodeHostEntry, DocSourceEntry, ToolPackEntry,
WritesConfig, Team and GlossaryEntry in @safran/profile are the types of its parts; Profile is its output
and ProfileInput what you may write.
export const profileSchema; // defined in packages/profile/src/schema.ts
export const DEFAULT_EMBEDDINGS = { type: "ollama", model: "bge-m3" } as const;defined in packages/profile/src/schema.ts
/** A validated profile: defaults applied, connector entries still carrying their type-specific fields. */
export type Profile = z.output<typeof profileSchema>;
/** What a user may write: every defaulted field optional. */
export type ProfileInput = z.input<typeof profileSchema>;defined in packages/profile/src/schema.ts
Common mistakes
- Writing
project:on a tracker. Trackers takeprojects, a list. (Theazure-reposcode host acceptsprojectas shorthand for a single entry of its ownprojects; that is a field of that connector, not of the profile.) - Listing only one of
languages.ticketsandlanguages.code. Both are required once the key is present. - Expecting
include: [payments]to matchpayments-api. Patterns cover the whole name. - Putting a token in the file.
_envfields hold a variable name; see Secrets.