Tracking Agents in Span
Last updated: October 30, 2026
Agents are AI tools that write code or review pull requests on their own, such as GitHub Copilot, Cursor in agent mode, Claude Code, Devin, Codegen, or a bot your team runs itself. Span treats each agent as its own entity alongside People and Teams, so you can see what your agents contribute to your engineering output and who worked with them.
Why it matters
For admins: mapping a bot account to an agent keeps its pull requests off people's numbers and puts them on the agent's own page, where you can track them.
For managers: attribution rules credit the engineer who worked with the agent, so a person's metrics include agent work they drove, and nothing they only watched.
How it works
How Span decides who owns an agent's pull request
Span follows the pull request author. Span reads the author from your Git host. When that author is a bot username mapped to an agent (for example
release-bot[bot]), the pull request belongs to the agent and shows on the agent's metrics, not on a person.An attribution rule can credit a person as well. A rule of type Extract the collaborating person looks for an email address in the pull request. When it finds one that belongs to a person in Span, Span credits that person too. The pull request then counts on the person's metrics (and their teams') and stays on the agent's page.
If no email is found, the pull request stays with the agent. Automated pull requests with no human in them, such as incident fixes a bot opens on its own, count only for the agent.
Where Span looks for the person
A rule can read four places. Assignees, reviewers, and labels aren't among them, so a rule can't credit "the first assignee".
Applies to | Field | What it reads |
|---|---|---|
Pull requests | PR description | The pull request body |
Pull requests | PR head branch | The source branch name |
Commits | Commit message | The messages of the commits on the pull request |
Commits | Commit author email | The author email of the commits on the pull request |
Built-in and custom rules
Built-in rules cover well-known tools. For example, on a pull request opened by a mapped agent account, a
Co-Authored-By: Name <email>line in the PR description or a commit message credits that person with no setup.Custom rules are ones you add to an agent. There are two types:
Attribute to this agent: when the pattern matches, the pull request or commit is the agent's work. Use it when the agent opens pull requests under someone else's account, or leaves a text marker instead of using its own bot account. In that case the human author keeps the credit and the agent is added alongside them.
Extract the collaborating person: the pattern captures the email of the person who worked with the agent. It applies to pull requests opened by the bot account mapped to this agent.
Custom rules come first. When one of your rules and a built-in rule both match, yours wins.
How patterns match
A pattern is a regular expression in Python syntax. It matches anywhere in the field and ignores case.
An Extract the collaborating person pattern must capture the email in a named group, for example
(?P<email>\S+@\S+).A pattern can be up to 400 characters. Span rejects patterns that nest one unlimited repeat inside another, such as
(a+)+, and named backreferences such as(?P=name).
Setting up an agent
Head to Settings → Agent Management to get started. You need the Member Management permission, which Owners and Admins have by default.
Let Span find them for you
If Span spots agent-like accounts in your connected GitHub, GitLab, or Azure DevOps, you'll see a banner that says "We've detected X agent(s) in your data." Click See all to open the Detected Agents dialog, then click Add on any card to pre-fill the Create Agent form. This is the easiest path if you already have agents running.
Or create one yourself
Click Create Agent in the top right and walk through the dialog:
Pick a tool. Choose from the supported list (Copilot, Cursor, Claude Code, and others) or select Other for a custom agent. Tools that are already assigned don't show up in the list.
Use default configuration (optional, supported tools only). Check this box and Span fills in the capabilities and usernames with recommended defaults. Those fields lock.
Add a name and description. For supported tools, the name is filled in and locked at creation. If you picked Other, enter a name; the description is optional.
Choose capabilities. Pick one or both: Code Generation and Code Review.
Map Git accounts. For each connected Git host, enter the bot username(s) the agent uses to open pull requests or leave reviews, for example
release-bot[bot]. You can add more than one per host if the agent shows up under several accounts.
Click Create. A confirmation message confirms the agent was added.
Add attribution rules
In Settings → Agent Management, open the ⋮ menu on the agent's row and choose Edit.
Scroll to Attribution rules and click Add rule.
Pick the rule type: Attribute to this agent or Extract the collaborating person.
Pick what it applies to, Pull requests or Commits, then the field: PR description or PR head branch for pull requests, Commit message or Commit author email for commits.
Enter the pattern.
Paste a real PR description or commit message into the sample box and click Test. Span shows whether the pattern matched and which emails it captured.
Click Add. Span confirms with "Rule added".
Rules can't be edited in place. To change one, remove it with the trash icon and add the new version.
Editing or deleting an agent
Open the ⋮ menu on any row in the Agents table.
Edit lets you update the name, description, capabilities, usernames, and attribution rules. The tool type is permanent, so if you picked the wrong one, delete the agent and start over.
Delete removes the agent for good, after a confirmation prompt.
Seeing what your agents are up to
Go to Organization → Agents in the sidebar to see all your configured agents in one place. Click any agent to open its detail page, where you'll find:
A metrics dashboard with standard development metrics attributed to that agent (PRs merged, code reviews, and so on).
An activity log showing the agent's contributions over time.
An agent selector at the top of the detail page lets you jump between agents without going back.
Things to know
Worked example. Your on-call bot opens pull requests as
release-bot[bot]. You map that username to an agent named Release Bot and add a rule: Extract the collaborating person, Pull requests, PR description, patternOn-call:\s*(?P<email>\S+@\S+). In one week the bot merges 10 pull requests:3 descriptions say
On-call: dana@yourcompany.com. Each counts for Release Bot and for Dana.1 says
On-call: lee@yourcompany.com. It counts for Release Bot and for Lee.6 are automated incident fixes with no email. One of them has Dana as the GitHub assignee. All 6 count only for Release Bot, because assignees aren't read.
Release Bot shows 10 PRs merged that week, Dana gains 3, and Lee gains 1.
One person per pull request. If a rule captures several emails, Span credits the first one that belongs to a person in Span. It checks the PR description and head branch before commit messages and commit author emails.
The email has to match a person in Span. Span compares the captured email to each person's email, ignoring case. An email that doesn't belong to anyone in your roster credits no one, and the pull request stays with the agent.
Changing rules reprocesses your history. Adding or removing a rule makes Span recalculate attribution for all your past pull requests and commits on its next processing run, so older numbers can shift for both the agent and people.
Usernames must match exactly. Span ties an agent to the usernames you enter, so they need to match the bot accounts. Otherwise its pull requests won't be picked up, or will count for whoever the account is mapped to.
Don't ignore an agent's username. A username on Ignore Git Usernames in Settings → Metrics drops its pull requests from metrics entirely, including the agent's. Map AI agents here instead, and ignore only bots you don't want to measure, such as dependency updaters.
Tool type is permanent. Once you create an agent, you can't change the tool. Pick carefully, or delete and recreate it.
One agent per supported tool. Copilot, Cursor, and the other supported tools can each be assigned to only one agent at a time.
Related articles
Linking people to their GitHub and GitLab accounts
Troubleshooting GitHub Data Quality
Need help?
Contact your Span account team or reach out to support@span.app.