# trusted publishing

> Set up and debug OIDC trusted publishing for npm and PyPI releases via GitHub Actions.

trusted publishing is a free AI agent skill on Agensi by Steve Peak, in APIs & Backend. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Steve Peak](https://www.agensi.io/creators/steve-peak)
- Category: [APIs & Backend](https://www.agensi.io/skills/apis-backend)
- Uses: 1
- Version: 1.0
- Last updated: 2026-10-18
- Security: scan passed (2026-10-18); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/trusted-publishing
- Tags: api, github-actions, npm, pypi, oidc, devops

## About this skill

Tokenless releases provide better security than long-lived secrets, but the setup is prone to silent failures. Most OIDC issues manifest as generic authentication errors, leaving developers guessing about version mismatches, environment name collisions, or outdated CLI versions. This skill eliminates the trial-and-error of configuring GitHub Actions for npm and PyPI.

### What it does
- **Configures OIDC trusted publishing** to replace vulnerable NPM_TOKEN and PyPI API secrets with short-lived GitHub tokens.
- **Enforces provenance and SLSA** by integrating `--provenance` flags and automated attestations into the release flow.
- **Debugs OIDC failures** by identifying mismatches between job environments, workflow filenames, and registry configurations.
- **Validates release integrity** through pre-publish checks that ensure tags match `package.json` versions to prevent irreversible failures.
- **Orchestrates MCP Registry updates** by managing version synchronization across `server.json` and package manifests.

### How it works
1. **Analyze existing workflows** to identify token-based auth or failing OIDC configurations.
2. **Apply registry-specific rules** such as the npm 11.5.1 requirement and `id-token: write` permissions.
3. **Insert safety guards** that run `npm pack` and version comparisons before the irreversible publish step.
4. **Deploy dedicated workflows** for multi-destination releases to ensure individual failures can be retried.

### Frameworks & tools
GitHub Actions, npm, PyPI, OIDC, Node.js, Python, and the Model Context Protocol (MCP).

### Why this beats prompting it yourself
Generic prompts often miss the specific Node 22/npm 10 trap where the bundled npm version lacks OIDC support. This skill includes the specific tag-matching logic and workflow partitioning strategies that prevent broken, unfixable releases.

### Use cases
- Migrating a repository from legacy secrets to tokenless OIDC publishing.
- Troubleshooting `EOTP` or 403 errors in a GitHub Actions publish job.
- Setting up an MCP server for automated npm and MCP Registry distribution.
- Adding SLSA provenance to a Python or JavaScript package build.

### Known limitations
Does not support registries other than npmjs.com and pypi.org. Requires GitHub Actions as the CI provider. Environment-based OIDC claims may conflict with ref-based consumers like the MCP Registry.

## Requires

- GitHub Actions
- Node.js 24+ (for npm packages)
- Python 3 (for PyPI packages)

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the trusted publishing skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### How does this skill help me move away from static npm and PyPI tokens?

This skill automates the transition from long-lived, vulnerable secrets to short-lived OIDC tokens. It specifically solves the 'silent failure' problem by debugging mismatches between GitHub job environments and registry settings that typically cause generic 403 errors.

### Which AI agents or frameworks are supported?

The skill is compatible with any AI agent that has file-system and terminal access, specifically optimized for agents using the Model Context Protocol (MCP) to manage automated registry updates.

### Can I use this skill to configure publishing for GitLab or private Artifactory registries?

No, this skill is purpose-built for GitHub Actions and the official npm and PyPI registries. It relies on specific OIDC claim structures unique to these platforms to ensure secure, tokenless authentication.

### What exactly is included in the 'trusted publishing' skill package?

You receive the specialized logic for OIDC configuration, workflow templates for npm/PyPI, safety-guard scripts for version validation, and a diagnostic suite for troubleshooting common authentication failures.

### Does the skill handle the specific CLI version requirements for provenance and OIDC?

The skill includes specific logic to handle the npm 11.5.1+ requirement and Node.js 22 compatibility issues. It automatically inserts the necessary 'id-token: write' permissions and provenance flags that are often missed in manual setups.

### How does it handle updates for MCP (Model Context Protocol) servers specifically?

Yes, it includes a dedicated orchestration step that synchronizes versioning between your 'package.json' and your MCP 'server.json' to ensure your server stays current on both npm and the MCP Registry.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
