Safeguard
Security Guides•

What permissions should a security automation token have?

Give each security automation its own service account and a token scoped to the few actions it needs. A permission matrix and rotation habits.

Safeguard Security Team
3 min read

A security automation token should belong to its own service account and carry only the permissions its job needs: for example create and comment on tickets, but not delete projects or change workflows. Scope it narrowly, give it an expiry, and rotate it.

Start from the job, not the platform

List what the automation actually does, then grant exactly that.

Automation jobNeedsDoes not need
Create tickets from findingsCreate issue, add comment, read projectDelete issue, edit workflow, admin
Post alerts to chatPost to named channelsRead private channels, manage users
Open fix pull requestsWrite to a branch, open a pull requestMerge, change branch protection
Read scan resultsRead findingsWrite anything
Update ticket statusTransition issuesChange permissions

Rules to apply

  1. One identity per automation. Do not reuse a person's account or a shared admin token, because you lose accountability and a leaver breaks the integration.
  2. Narrow scope. Use the smallest scope your platform offers, and limit it to specific projects, repositories or channels.
  3. Short life. Prefer tokens with an expiry. If the platform cannot expire them, set a calendar rotation.
  4. Separate environments. Test automation should not hold production credentials.
  5. No merging by bots. A pull request opened by automation should still need a human review and passing checks. Keep branch protection that the bot cannot change.
  6. Store secrets in a secrets manager, never in a repository, a ticket or a chat message.

Plan for rotation

Rotation breaks things when nobody remembers where a token is used. Keep an inventory: token name, owner, systems that use it, scope, expiry. When you rotate, create the new token first, switch the consumer, then revoke the old one.

Watch for signs of misuse

Alert on actions outside the normal pattern, such as a ticket automation suddenly reading many projects, or running at an unusual hour. Combine this with the audit record described in what audit trail security automation should keep.

If a token leaks

Revoke it first, then review what it did during the exposure window, then issue a replacement. See the first hour after leaking an API key.

Quick check

Can I reuse my own personal token for an integration?

Avoid it. If you leave or change role, the integration breaks, and its actions are attributed to you.

Should an automation be allowed to merge its own pull requests?

No. Keep human review and required checks. The bot opens the pull request, people approve it.

Safeguard supports agent identity and an MCP Guardrail for governing tool access, with a free scan at gold.safeguard.sh/scan.

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.