Coding

Limit credential exposure with fine-grained personal access tokens

Fine-grained personal access tokens in beta now allow developers to scope authentication to specific tasks, limiting credential exposure and preventing broad permissions across multiple projects and groups. This shift in token management enables teams to issue read-only tokens for individual projects, rather than relying on a single token with far-reaching privileges. The result is a more secure automation stack.

GitLab has introduced fine-grained personal access tokens (PATs) in beta, allowing developers to scope authentication to specific tasks and projects rather than granting broad permissions across the entire account.

Overview

Personal access tokens authenticate most automation in GitLab — CI/CD pipelines, API calls, container registry pushes, and more. Traditionally, a PAT with a scope like api or read_api extends permissions across every project and group the token owner can access. If that token leaks, an attacker gains the same reach as the user.

Fine-grained PATs, now in beta, let you define a token's scope along two dimensions: which projects or groups it can reach, and what it can do there. Instead of one token that can do everything you can do, you issue one token per job, carrying exactly that job's permission set.

What it does

You can define a fine-grained PAT by selecting:

  • Where it can reach: personal projects only, all projects and groups you're a member of, or only the projects and groups you select.
  • What it can do there: per-resource permissions across Issues, Merge Requests, Pipelines, Repositories, Container Registry, and more, with Create, Read, Update, and Delete assigned independently for each resource.

For example, a pipeline that pushes container images no longer needs an api-scoped token. It gets a token scoped to the Container Registry on a single project, with Create and Read permissions only. If that token leaks, the blast radius is one registry on one project, not your entire footprint.

Tradeoffs

GitLab advises against using fine-grained PATs in production workloads until general availability. The beta currently covers about 75% of REST API endpoints. Support for the remaining REST endpoints and expanded GraphQL coverage is planned for the coming months.

Existing PATs continue working as before. During the beta, you can create traditional and fine-grained PATs side by side.

How to create one

To create a fine-grained personal access token:

  1. Navigate to User Settings → Personal Access Tokens.
  2. Choose "Fine-grained token" from the Generate token dropdown.
  3. Define the scope (projects/groups and per-resource permissions).

The tokens table has been updated to show exact scopes and per-resource permissions for every token, making over-privileged tokens easier to spot during reviews.

Bottom line

Fine-grained PATs join existing safeguards like lifetime limits and automatic revocation. For teams practicing least-privilege automation, they provide a practical way to limit credential exposure to exactly what a job requires — and no more.

Similar Articles

More articles like this

Coding 1 min

Visual Studio Code 1.120

Visual Studio Code’s 1.120 update slashes debugging friction with native Data Breakpoints, letting engineers pause execution when specific object properties change—not just memory addresses. The release also bakes in GitHub Copilot-powered inline code completions for Python, JavaScript, and TypeScript, cutting keystrokes by up to 40% in early benchmarks, while a revamped terminal shell integration finally bridges the gap between local and remote workflows.

Coding 1 min

Show HN: Stage CLI – a tool to make reading your AI generated changes easier

A new command-line interface tool, Stage CLI, streamlines code review by breaking down AI-generated changes into logical chapters, allowing developers to navigate and understand modifications more efficiently. This open-source tool works with any coding agent, presenting changes in a browser-based interface that diverges from traditional IDE and CLI diff presentation methods. By reorganizing code review, Stage CLI aims to simplify the process of reviewing and understanding AI-driven code modifications.

Coding 1 min

Motherboard sales are now collapsing amid unprecedented shortages fueled by AI

"Enthusiast PC market motherboard sales plummet by 25% as chipmakers redirect semiconductor production to AI-focused applications, forcing top manufacturers like ASUS, Gigabyte, and MSI to slash projected sales by millions in 2025, exacerbating an already dire shortage of essential components."

Coding 1 min

AlphaEvolve: Gemini-powered coding agent scaling impact across fields

"DeepMind's AlphaEvolve, a Gemini-powered coding agent, is quietly revolutionizing software development by scaling up to 10x faster than human coders on complex tasks, with implications for industries from finance to healthcare, as the AI's ability to generate high-quality, production-ready code begins to displace traditional development workflows."

Coding 1 min

Cloudflare responded to the "Copy Fail" Linux vulnerability

Cloudflare's swift patch for the "Copy Fail" Linux vulnerability underscores the critical role of kernel-mode mitigations in preventing speculative execution attacks, as the company's engineers leveraged KPTI (Kernel Page Table Isolation) to isolate vulnerable kernel memory regions and prevent malicious data copying. The fix, which affects Linux distributions from 4.14 to 5.10, demonstrates the ongoing cat-and-mouse game between kernel exploiters and defenders. Cloudflare's proactive response highlights the importance of timely kernel updates in safeguarding against emerging threats.

Coding 1 min

Building the TD4 4-Bit CPU

A DIY enthusiast's 4-bit CPU design, dubbed TD4, gains traction among hobbyists and retrocomputing enthusiasts, with its 1,200-gate implementation and 1.5 MHz clock speed sparking interest in the maker community. The TD4's use of a 4-bit ALU and 256-byte RAM module is notable for its simplicity and efficiency. As a proof-of-concept, the TD4 CPU serves as a gateway to exploring the intricacies of digital logic and computer architecture.