---
title: "Feature flags, Railway Agent in Slack & Discord, usage limits in the CLI"
date: 2026-07-10
number: 0298
url: https://railway.com/changelog/2026-07-10-feature-flags
---

# Feature flags, Railway Agent in Slack & Discord, usage limits in the CLI

Merge on Friday, launch on Monday. Feature flags land on Railway this week, so you can ship code dark and flip it on when you're ready, from the dashboard, the CLI, or the SDK. The Railway Agent also joins you in Slack and Discord, and the CLI learns to estimate your bill and set usage limits.

Let's get into it! 🚄

## Feature flags

[Video: Manage feature flags under your project settings]

Railway now includes feature flags: a typed configuration registry scoped to your project, built for gradual rollouts, kill switches, and runtime tuning. Define a flag as a bool, string, number, or JSON value, give it a default, and change it at runtime without a redeploy.

You can manage flags from three places:

- **Dashboard**: open your project and navigate to **Settings → Feature Flags** to create flags, edit values, and add targeting rules.
- **CLI**: `railway flag list` shows every flag in a project, and `railway flag set checkout.v2 true` creates or updates one. Add targeting rules with `--when`, like `railway flag set checkout.v2 true --when 'plan == "enterprise"'`.
- **SDK**: initialize the TypeScript SDK with a project token and read flags directly from your code. Reads are synchronous and in-process, with background polling keeping values fresh, so checking a flag never blocks a request.

```typescript
import { flags } from "railway";

await flags.init();
const enabled = flags.getBoolean("checkout-v2", { key: userId, plan: "enterprise" }, false);
```

Targeting rules compare context attributes you pass from your app and support percentage-based bucketing, so you can roll a feature out to 25% of users, gate it to a specific plan, or shut something off everywhere with one change. When no rule matches, the flag falls back to its default.

Flags fill a gap variables can't. Changing a variable redeploys your service, which is the right behavior for secrets and static configuration. Changing a flag takes effect in seconds, which is what you want for rollouts and kill switches. Before this, runtime toggles on Railway meant running your own flag service or wiring up a third-party provider.

Read the [feature flags docs](https://docs.railway.com/feature-flags), and let us know what you think in this [Central Station thread](https://station.railway.com/feedback/feedback-feature-flags-969d8a64).

## Chat with the Railway Agent from Slack and Discord

[Video: Mention @Railway in Slack or Discord to work on your projects from chat]

The Railway Agent now lives where your team already talks. Mention **@Railway** in Slack or Discord to ask about your projects, inspect deployments, read logs, and make changes without leaving chat.

Setup has two halves. A workspace admin connects the chat platform to a Railway workspace: install the Slack app and run `/railway-link`, or add the Discord app and run `/link workspace`. Then each teammate links their chat identity to their Railway account. The agent acts with your personal access level, checked on every message, so you can only see and change what you already could in the dashboard. If you leave the Railway workspace, the agent stops responding to you immediately. Usage is billed to the connected workspace at standard rates.

Agent integrations are in beta, so expect rough edges and the occasional breaking change. That's exactly why we want you on it. Try it with your team, read the [agent integrations docs](https://docs.railway.com/ai/agent-integrations), and tell us what works and what doesn't on [Central Station](https://station.railway.com/new?type=feedback).

## Workspace and Agent usage limits in the CLI

[Image: railway usage command]

The CLI now answers "how much is this costing me" with the new `railway usage` command:

- `railway usage` summarizes the workspace: billing period, usage so far, and an estimated bill projected to the end of the period, along with any limits you've set.
- `railway usage projects` ranks your projects by estimated cost, including recently deleted projects that still accrued usage. Pass `--project` to break a single project down by service and resource: CPU, memory, egress, volumes, and backups. These breakdowns are estimates computed from measured resource usage at standard rates, so read them as a close approximation of your invoice rather than the invoice itself.
- `railway usage limit status` shows your workspace and Railway Agent limits, and `railway usage limit set` updates them. Set workspace soft and hard limits in dollars with `--target workspace --soft 100 --hard 150`, or cap Agent spend with `--target agent --hard 25`. Setting an Agent hard limit of 0 blocks Agent usage entirely.

Every command supports `--workspace`, `--period` (current, previous, or a specific month like 2026-06), and `--json` for scripts and agents.

Before this, checking usage or setting limits meant opening workspace settings in the dashboard. The CLI exposes the same picture in a scriptable form, so you can watch spend from the terminal or let an agent enforce a budget for you.

Update with `railway upgrade`, run `railway usage --help`, and let us know what you think on [Central Station](https://station.railway.com/new?type=feedback).

## Fixes and improvements

- We shipped explicit project targeting for `railway status`. Pass `--project` to check any project you have access to, where the command previously reported only the linked project.
- We fixed a race in CLI token refresh that could sign you out when several commands refreshed credentials at once.
- We improved the CLI's autoupdate check by shortening the check window, so new releases reach you sooner.