# Upgrading Hex security

DevFeed: [Upgrading Hex security](<https://devfeed.tech/articles/upgrading-hex-security-51512.md>)

Original publisher: [Read original article](<https://gleam.run/news/upgrading-hex-security>)

Author: Louis Pilfold

Published: 2026-03-16T00:00:00Z

Content type: release

Language: en

Sources: [Gleam](<https://devfeed.tech/sources/gleam.md>)

Topics: [MFA](<https://devfeed.tech/topics/mfa.md>), [Package Management](<https://devfeed.tech/topics/package-management.md>), [Secure token management](<https://devfeed.tech/topics/secure-token-management.md>), [Access Control](<https://devfeed.tech/topics/access-control.md>)

Tags: [access-tokens](<https://devfeed.tech/tags/access-tokens.md>), [authentication](<https://devfeed.tech/tags/authentication.md>), [erlang](<https://devfeed.tech/tags/erlang.md>), [gleam](<https://devfeed.tech/tags/gleam.md>), [hex](<https://devfeed.tech/tags/hex.md>), [identity-management](<https://devfeed.tech/tags/identity-management.md>), [legacy](<https://devfeed.tech/tags/legacy.md>), [multi-factor-authentication](<https://devfeed.tech/tags/multi-factor-authentication.md>), [oauth2](<https://devfeed.tech/tags/oauth2.md>), [password](<https://devfeed.tech/tags/password.md>), [permissions](<https://devfeed.tech/tags/permissions.md>), [providers](<https://devfeed.tech/tags/providers.md>), [security](<https://devfeed.tech/tags/security.md>), [stolen-credentials](<https://devfeed.tech/tags/stolen-credentials.md>)

## AI overview

Gleam v1.15.0 switches Hex authentication exclusively to OAuth2: write actions require multi-factor authentication, clients no longer handle passwords, tokens expire quickly, and Hex can use external OAuth providers. On first Hex use, the new Gleam version revokes locally stored legacy tokens; legacy authentication for Gleam packages is slated for future deactivation. Passwords encrypting local Hex tokens must be at least eight characters. The release also improves Hex error messages, guard expressions, JavaScript FFI and generated TypeScript types, and language-server features such as folding, renaming and more precise completions. Publishing now rejects packages with no README or the default generated README. Configuration keys `dev-dependencies` and `tag-prefix` are moving to snake_case; old spellings remain supported but are deprecated. The supplied text also describes CLI documentation and code-action improvements.

## Source excerpt

Gleam is a type safe and scalable language for the Erlang virtual machine and JavaScript runtimes. Today Gleam v1.15.0 has been published, let's go over what's new. The Hex package manager Gleam is a BEAM language, so it uses Hex, the package manager of the Erlang ecosystem. Hex recently introduced a new OAuth2 based authentication system, replacing the old system of exchanging the account's username and password for a long-lived token. This new system has many security advantages: Multi-factor authentication is used for all endpoints that require write permissions, so stolen credentials or tokens are insufficient to perform sensitive actions. Hex clients such as Gleam never see your password, so there is less opportunity for an attacker to harvest credentials given access to your workstation. The access tokens are short lived, so if stolen there is only a small window in which they could be used by the attacker. The Hex site can integrate with other OAuth providers, enabling companies to use their existing identity management and audit systems to secure Hex. Gleam now uses exclusively this new system for authentication, and any existing legacy tokens that Gleam has stored locally will be revoked the first time that the new version of Gleam is used with Hex. The legacy system will be disabled for Gleam packages in future. Lastly, the password used for encrypting local Hex tokens must now be at least 8 characters in length. This work was done in collaboration with The Erlang Ecosystem Foundation. A huge thank-you to Jonatan Männchen and the rest of the team there! If you would like to support important infrastructure projects for the whole ecosystem consider becoming a member of the foundation. Better Hex errors It's possible for Hex operations to fail, for example, attempting to depend on a package that does not exist, or attempting to publish a new version of a package that you are not the maintainer of. When this happens we typically show the programmer the error