Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

@loomwork/middleware

Latest version: v0.1.7

Overview

Last scanned
24 Nov 2026
Published
24 Nov 2026
npm package Publisher: chhetrisushil
0 Stars
0 Forks
9 Versions
1.3K Downloads
TypeScript Repo language

Scan summary

@loomwork/middleware was last scanned on 24 Nov 2026 at version 0.1.7. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 9 versions; the latest 3 were published within 2 days (23 and 24 Nov 2026).
  • Findings: No rules fired in version 0.1.7.
  • Downloads: 1,271 downloads.

Versions

9 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.1.7 LATEST 24 Nov 2026 No rules fired
0.1.6 23 Nov 2026 No rules fired
0.1.5 23 Nov 2026 No rules fired
0.1.4 17 Nov 2026 Not shown
0.1.3 17 Nov 2026 Not shown

No rules fired in 0.1.7

Findings

Findings for v0.1.7. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.1.7; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

@loomwork/middleware

Effect middleware: wrappers that run around every tool or model call. This package has the first-party ones: retry with backoff, token and cost metering with budgets, behavioural safety validators, secret redaction, rate limits, a scoped kill switch, claim-check offload of large results, and timing. Use it when a policy belongs on the effect path (before a call runs or after it returns) rather than inside a flow. Wire it through defineConfig or new EffectRuntime(middleware).

import { defineConfig } from "@loomwork/app";
import {
  denyPatterns,
  llmUsageTokens,
  meteringMiddleware,
  retryMiddleware,
  safetyMiddleware,
} from "@loomwork/middleware";

const app = defineConfig({
  storage: { kind: "memory" },
  execution: {
    // The first entry is outermost: safety and quota refusals sit outside the retry loop.
    effectMiddleware: [
      safetyMiddleware({ validators: [denyPatterns([/ignore previous instructions/i])] }),
      meteringMiddleware({
        pricing: ({ result }) => ({ tokens: llmUsageTokens(result) }),
        budget: { maxTokens: 200_000 },
      }),
      retryMiddleware({ maxRetries: 2, baseDelayMs: 200 }),
    ],
  },
});

Surface

  • Reliability. retryMiddleware, rateLimitMiddleware (token bucket per execution, tenant, workflow or process), effectTimingMiddleware (measures what effects cost).
  • Cost. meteringMiddleware (records RESOURCE_METERED, enforces a Budget), nestedBudgetMiddleware with BudgetLedger (tenant, workflow and execution ceilings together), streamTokenBudget (a mid-stream guard), QuotaExceededError.
  • Safety. safetyMiddleware with denyPatterns, piiValidator, schemaValidator, killSwitch; killSwitchMiddleware with InMemoryKillSwitch (stop all, a tenant, or a workflow).
  • Data. redactionMiddleware with secretRef and SecretResolver; claimCheckMiddleware with resolveClaimCheck and previewDigest.

Behaviour that surprises people

  • Order is outermost first, and it matters. defineConfig itself puts, from the outside in: kill switch, claim-check, redaction, the autonomy envelope (rate limit, budget), then your effectMiddleware. A retry wrapper placed outside a refusing middleware would re-attempt the refusal.
  • Retry is in-memory and quiet. Retries inside one execute write no events; use onRetry to observe them. It never retries a SuspendError or an aborted execution. By default it also skips a TypedFailure and any error with retryable: false (safety, quota, rate limit and kill switch errors all set it). Defaults: 2 retries, 100 ms base, factor 2, 30 s cap, deterministic jitter.
  • A budget is checked before an effect, not during it. Metering refuses the next effect once spend is at or over the budget, so the call that crosses it still runs and is metered. Use streamTokenBudget to cut a streamed call mid-flight.
  • Rate limits are per process. Bucket state is local, wall-clock driven and never logged, so two nodes each enforce their own limit. Buckets are LRU-bounded (10,000 by default).
  • The kill switch refuses the next effect. It does not interrupt one already running, and it fails closed if its registry throws.
  • Safety validators run on live execution only. A replay serves completed steps from the log and does not call them. A block is recorded as SAFETY_BLOCKED. For a streamed call, an output validator without a delta form makes the runtime refuse streaming to every delta sink, and the delta check sees only a trailing window (4096 characters by default), so a pattern longer than that can slip through the live tail.
  • piiValidator is a few regular expressions (email, US SSN, card-like digits), not a classifier.
  • Claim-check defaults differ. The middleware's inline cap is 16 KiB; defineConfig's execution.claimCheck defaults to 1 KiB. An offloaded blob is TTL-reclaimable unless retain is set.

See also

  • API reference: section "@loomwork/middleware — effect middleware" in docs/api-reference.org.
  • Guide: quotas, supervision and cancellation.
  • ADRs: 0054 claim-check, 0119 streaming deltas, 0140 claim-check for agent state.

Install

Unpublished for now: inside this repo use workspace:*; from a sibling checkout use a link: override (see AGENTS.md).

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm @loomwork/middleware

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Cry2Wolf: How to Tell a Real Bug from a Nothingburger
AI & VibeSec

Cry2Wolf: Not Every Branded Bug Deserves a Fire Drill

Vulnerability Insights

Compromised Claude Code extensions (versions 2.1.312 & 2.1.313) in Cursor try to install a backdoor

Microsoft's Official agent framework Hijacked
AI & VibeSec

BREAKING: Hijacked Releases of Microsoft’s Official agent-framework Steals Azure and CI Credentials

Frame 2085668439 (1)
Group 1261154229