Skip to main content
Resilience engineering, refined

Code that stays standing.

Fast resilience for .NET. Every strategy you need, composed through one fluent shield API.

INSTALLdotnet add package Kevlar
ResilientUserService.csSHIELD ACTIVE
var shield = Shield
.Timeout(TimeSpan.FromSeconds(30))
.Retry(3)
.CircuitBreaker(
5,
breakDuration: TimeSpan.FromSeconds(30));

var user = await shield.ExecuteAsync(
ct => LoadUserAsync(id, ct), cancellationToken);
Request protected0 B allocated
One shield. Every failure mode.
RetryCircuit breakerTimeoutRate limitConcurrency limitHedgingFallback
Engineered differently

Less framework.
More resilience.

Kevlar strips away accidental complexity without giving up the control, performance or observability production systems need.

01API

Readable by design

Shield.When<TimeoutException>().Retry(3) reads like intent, not infrastructure. Use concise defaults or take full control with options objects.

02100 ns

Built for the hot path

Struct outcomes, pooled contexts, state-passing overloads and ValueTask end to end keep successful calls fast and allocation-free.

03SAFE

Defaults you can ship

Shield.Retry(3) includes exponential backoff with jitter, capped at 30 seconds—the production setting you wanted anyway.

04FLUENT

Composition, not ceremony

Chain strategies fluently. Merge shields with Wrap and Compose. Reuse one instance when state should be shared.

050 DEPS

Nothing hiding underneath

Core Kevlar depends on nothing but the BCL. No surprise transitive packages, version conflicts or dependency-tree baggage.

06.NET

Old apps. New apps.

Targets netstandard2.0 and net8.0, with integrations for Microsoft DI and HttpClientFactory.

Measured, not marketed

Tiny overhead.
Serious protection.

100 ns

Successful Retry(3) execution

0 B

Allocated on the happy path

0 deps

In the core package

Explore the benchmarks
Designed for intent

Protection that
reads like code.

Build complete resilience pipelines from focused strategies. Sensible defaults keep common cases concise; options objects give you full control when you need it.

KevlarSensible defaults
var shield = Shield
.Timeout(TimeSpan.FromSeconds(30))
.Retry(3)
.CircuitBreaker(5,
breakDuration: TimeSpan.FromSeconds(30));
Timeout · Retry · Circuit breakerOne fluent API
KevlarFull control
var search = Shield.For<HttpResponseMessage>()
.When<HttpRequestException>()
.OrResult(r => (int)r.StatusCode is >= 500 or 429)
.Fallback((outcome, ct) => cache.GetCachedAsync(ct))
.Retry(o =>
{
o.MaxRetries = 4;
o.DelayGenerator = e =>
e.Outcome.Result?.Headers.RetryAfter?.Delta;
o.OnRetry = e => logger.LogWarning(
"retry {Attempt} in {Delay}", e.Attempt, e.Delay);
})
.CircuitBreaker(o =>
{
o.FailureRatio = 0.5;
o.SamplingWindow = TimeSpan.FromSeconds(30);
o.Monitor = monitor;
})
.Hedge(maxAttempts: 2, delay: TimeSpan.FromMilliseconds(150))
.Timeout(TimeSpan.FromSeconds(2))
.WithName("search");
Typed results · Retry-After · Hedging · FallbackSame fluent API
Ready for impact

Wrap your first call in minutes.

Get started