Skip to main content
FAST RESILIENCE FOR .NET

Built to
take a hit.

Dependencies fail. Your application doesn’t have to. Wrap every call in a little Kevlar.

Retries, circuit breakers, timeouts and more.
Seven strategies. One fluent shield API.

dotnet add package Kevlar
STRONG PROTECTION. LIGHT FOOTPRINT.
NativeAOT readyAllocation-consciousOpen source
LESS CEREMONY. MORE CONFIDENCE.

Looks like code.
Works like armor.

Build a shield once. Reuse it across calls. Protection reads in execution order, from the outside in.

  1. 01
    Set the budget

    Timeout bounds the whole operation.

  2. 02
    Handle the unexpected

    Retry adds backoff and jitter by default.

  3. 03
    Give failures a limit

    The circuit breaker stops repeated failures.

Walk through the quickstart
YourFirstShield.csC#
using Kevlar;

var shield = Shield
.Timeout(TimeSpan.FromSeconds(30))
.Retry(3)
.CircuitBreaker(
consecutiveFailures: 5,
breakDuration: TimeSpan.FromSeconds(30));

var user = await shield.ExecuteAsync(
ct => LoadUserAsync(id, ct), cancellationToken);
Timeout Retry Circuit breakerONE SHIELD
STRENGTH WITHOUT THE WEIGHT

Heavy on resilience. Light on everything else.

01 / PERFORMANCE

Light on the hot path.

Struct outcomes, pooled contexts and ValueTask keep successful calls fast. State-passing overloads avoid closure allocations.

Explore performance
02 / CONTROL

Your intent. Your rules.

Shield.When<TimeoutExceededException>().Retry(3) says what you mean. Start with sensible defaults; fine-tune with options.

Meet the fluent API
03 / COMPATIBILITY

Ready for your stack.

Targets netstandard2.0 and net10.0. NativeAOT-ready, with integrations for Microsoft DI and HttpClientFactory.

Find your starting point
READY FOR THE REAL WORLD

Give your code a fighting chance.

Get started with Kevlar