Skip to content
Back to skills

Nats Knowledge Patch

ASecurity

NATS Server

  • 25 stars
  • 0 votes
  • 1 copy
  • 6 views
  • Added September 5, 2026
developmentrustgonodeexpressapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add Nevaberry/nevaberry-plugins --skill nats-knowledge-patch --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Nats Knowledge Patch?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Nats Knowledge Patch
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nevaberry-nats-knowledge-patch-nevaberry-plugins/badge)](https://www.skillsdirectory.com/skills/nevaberry-nats-knowledge-patch-nevaberry-plugins)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: nats-knowledge-patch
description: NATS Server
version: "2.15.3"
license: MIT
metadata:
  author: Nevaberry
---


# NATS Server

Load this skill when configuring NATS Server, changing JetStream publishing
or consumers, managing sources and mirrors, upgrading deployments, or
troubleshooting networking, authentication, storage, and recovery.

Use the quick reference below for migration constraints and common operations.
The topic references contain the detailed behavior, examples, and version
attributions, including guidance reported for preview releases.

## Reference index

| Reference | Topics |
| --- | --- |
| [Streams and Publishing](references/streams-and-publishing.md) | API validation, atomic and fast batches, preconditions, TTL, delete markers, counters, schedules, retention, deduplication |
| [Consumers and Sourcing](references/consumers-and-sourcing.md) | Pull priority, pinning, consumer limits, pause and reset, acknowledgments, inactivity, durable sourcing, mirror promotion |
| [Networking and Accounts](references/networking-and-accounts.md) | ACK and flow-control subjects, mappings, permissions, JWTs, auth callouts, TLS, proxies, leafnodes, gateways, WebSockets, MQTT |
| [Operations and Recovery](references/operations-and-recovery.md) | Configuration, monitoring, tracing, health, placement, scaling, storage, restore, upgrades, downgrades |

## Breaking changes and migration constraints

### Strict API decoding and configuration validation

JetStream rejects requests with unknown JSON fields by default in 2.12.
Correct the request or update the client library, or temporarily restore
permissive decoding during migration:

```conf
jetstream {
  strict: false
}
```

Use pedantic mode when reconciling an asset against a desired configuration.
Stream and consumer creates and updates fail if applying server defaults
would change the requested configuration.

A server marks streams and consumers offline if it cannot support their
stored configuration values. If the JetStream metadata leader lacks support
for those values, it rejects updates.

### Consumer limits and immutable settings

In 2.15, new consumer creation is capped at 1,000 consumers per stream unless
the stream configuration or account limits specify `max_consumers`.
Set `default_max_consumers` in the server's JetStream limits to override the
default; `-1` disables it.

An update cannot change an existing consumer's storage type or whether the
consumer is direct or used for sourcing. Updating a stream on a standalone
JetStream server to request more than one replica fails.

### ACK subjects, permissions, and removed interfaces

Before the default ACK and flow-control format changes to v2 in 2.15, add v2
patterns to account imports, exports, or permissions scoped by stream.
The catch-all patterns `$JS.ACK.>` and `$JS.FC.>` match both formats.
When parsing ACK metadata, accept the 9-token v1 layout and the v2 layout
with 11 or more tokens. In v2, `_` in the domain position means no domain.
Publish acknowledgments to the supplied reply subject as-is.

Leafnode permissions apply to inbound JetStream acknowledgment traffic.
Include the required ACK subjects when using a leafnode allowlist.
For stream imports crossing a leafnode link, publish permissions apply to
the transformed subject sent over the link; allow that subject on the link.

Versions 2.14.8 and 2.15.1 remove gateway support for sending and receiving
the `$GR.` reply prefix used by servers older than 2.1.2. Clients cannot
publish to subjects starting with that reserved prefix.
Monitoring endpoints no longer wrap responses in JSONP callbacks; update
monitoring clients to read JSON.

### Authentication and TLS constraints

Clients using the `NoAuthUser` fallback must satisfy that user's connection
restrictions. Auth callout enforces the returned user JWT's `src` restriction;
user JWT payload-size and subscription-count limits apply to auth callout
and MQTT clients. In 2.15.3, encrypted auth callouts require a server XKey.

Insecure TLS cipher suites are disabled by default. Set
`allow_insecure_cipher_suites: true` if a deployment requires one.
The Go versions used by 2.14.9 and 2.15.2 distrust eMudhra intermediate
certificates as mitigation for CVE-2026-111943; affected TLS chains can fail
verification after upgrading.

### Downgrade and recovery constraints

Remove the entire `feature_flags` block before downgrading to 2.12.
Durables configured with `AckFlowControl` go offline until upgraded back to
2.14. Sourcing and mirroring may temporarily stall during a downgrade;
WorkQueue and Interest sourcing or mirroring on 2.12 uses ephemeral consumers.

When downgrading from 2.12 into the 2.11 line, use 2.11.9 or later so assets
using 2.12-only features go offline safely. The first startup on 2.11 rescans
stream message blocks to rebuild on-disk state; allow extra time to report
healthy. Version 2.14.7 supports the desired-state metadata introduced in
2.15, allowing safe upgrades and downgrades between those releases.

If restarts leave a single replica with an in-memory stream's data, bring
every replica of that stream back online. A quorum alone is insufficient.
A filestore I/O error freezes the affected stream and surfaces as a
`write error` in health checks. Restart the affected server to recover;
another replica can take over for a replicated stream.

## Publishing and stream features

### API levels and batch publishing

Read `_nats.ver` and `_nats.level` in stream and consumer metadata, and use
`_nats.req.level` to check the level needed by the asset configuration.
Set `Nats-Required-Api-Level` on a JetStream API request to declare the
minimum server API level needed to handle it.

Set `allow_atomic` on the stream to opt in at API level 2. Start a batch
with a batch ID of up to 64 characters and sequence `1`, then reuse the ID
and increment the sequence. `Nats-Batch-Commit: 1` stores the final message
and returns a PubAck with `batch`, `count`, and the final stream sequence.

The server checks atomic batch preconditions against stream state just
before commit. In 2.12.0, sequence gaps, failed preconditions, `Nats-Msg-Id`,
and `Nats-Expected-Last-Msg-Id` reject the whole batch. A batch holds up to
1,000 messages and is abandoned after 10 idle seconds without an error reply.

Enable `AllowBatchPublish` for fast, flow-controlled batch publishing on a
standalone or replicated stream. Preconditions are checked per message and
messages are ingested as the batch arrives. Atomic and fast batches accept
an end-of-batch control message that commits without storing that control
message. For a separate atomic commit request after the last data message,
set `Nats-Batch-Commit: eob`.

### Message TTL and delete markers

Enable `allow_msg_ttl` at stream creation or on an existing stream; the
opt-in is irreversible. `Nats-TTL: 60` or `Nats-TTL: 1m` expires a message
relative to its stream timestamp. `Nats-TTL: never` exempts it from
time-based expiration, including `MaxAge`.

Set `subject_delete_marker_ttl` to at least one second for a marker when
age-based expiration removes the last message on a subject. Enable rollups
and allow purges, especially in pedantic mode. Mirror configurations reject
`subject_delete_marker_ttl`. Sources and mirrors accept replicated TTL
headers even with local TTL disabled; enable `allow_msg_ttl` on the
receiving stream to enforce them there.

### Counters and schedules

Set `allow_msg_counter` at stream creation at API level 2. Use Limits
retention with discard-old behavior and leave per-message TTL disabled.
Publish a signed integer delta in `Nats-Incr`; the stored body and PubAck
have a string `val` field for the new arbitrary-precision total.
A subject purge alone resets a standalone counter but leaves downstream
totals intact.

Set `allow_msg_schedules` at API level 2 and give each schedule a unique
subject in the same stream as its target. The opt-in is permanent and can
be added to an existing stream. A later publish to the schedule subject
replaces the prior schedule. `@at` takes an RFC3339 timestamp and fires
immediately if overdue, including after a restart.

`Nats-TTL` limits the schedule's eligibility. With `allow_msg_ttl` enabled,
`Nats-Schedule-TTL` sets `Nats-TTL` on the generated message. Recurring
schedules support `@hourly`, `@every 5m`, and six-field UTC cron expressions
with seconds first. `Nats-Schedule-Source` samples a concrete subject's
latest stored message; `Nats-Schedule-Rollup` applies a rollup at the target.

## Consumers and replication

For overflow pulls, set `priority_policy` to `overflow` with explicit
acknowledgments. If both `min_pending` and `min_ack_pending` are present,
either threshold makes the pull eligible. Waiting pulls can receive heartbeats.

For `pinned_client`, use explicit acknowledgments and send the delivered
`Nats-Pin-Id` as `id` on later pulls. On status `423`, clear the stale ID
and pull again with the group. Set pull expiry below the pin timeout, which
defaults to two minutes and can be updated. A pull with the current ID renews
the pin. The `prioritized` policy lets lower-priority pulls receive work as
soon as higher-priority pulls are absent; returning higher-priority pulls
take precedence.

Set `PauseUntil` at creation or use the pause API. Delivery resumes at the
deadline, and heartbeats continue during the pause. A consumer reset clears
pending and redelivery state and restarts the consumer sequence at 1.
Clients should allow consumer sequences to restart after an external reset.
Advancing a sourcing consumer skips upstream messages; a mirror suppresses
duplicates when its consumer is rewound.

JetStream creates and reuses an ordered durable consumer to source or mirror
a WorkQueue or Interest stream, acknowledging after downstream persistence.
A sourcing consumer on a WorkQueue stream occupies its filter; use Interest
or Limits retention when another consumer needs overlapping subjects.
For stalled cross-account sourcing or mirroring flow control, check for
missing `$JS.FC.>` imports or exports.

## Operational quick reference

In 2.15.3, check a proposed configuration change with
`nats-server -c current.conf -t --test_reload proposed.conf`.
Exit code `3` means a restart is required. Compare the hash reported by
`nats-server -t -c nats.conf` with `config_digest` in `/varz` to check a file
against the running configuration.

Use `/healthz?js-server-only=true` for local JetStream readiness independent
of metadata leadership, or `/healthz?js-meta-only=true` for metadata group
health. `/healthz?leaf-remotes-connected=true` returns unavailable until
every enabled solicited leafnode remote is connected. `/healthz` skips
expired JWT accounts; track account JWT expiration separately.

Subscribe to an inbox and publish with `Nats-Trace-Dest` set to it to trace
ingress, egress, mappings, and account import/export crossings.
Add `Nats-Trace-Only: true` to collect events without delivering to original
subject subscribers. `Nats-Trace-Dest: trace disabled` turns off all server
tracing for that publish. Allow the trace destination in applicable leafnode
publish permissions when tracing over the link.

Files in this skill

  • SKILL.md9.1 KB
  • coverage.json616 B
  • references/consumers-and-sourcing.md4.8 KB
  • references/networking-and-accounts.md3.8 KB
  • references/operations-and-recovery.md3.3 KB
  • references/streams-and-publishing.md5.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.