A feasibility constraint is a hard logical rule encoded into a counterfactual generation algorithm that prevents the modification of immutable features or enforces causal monotonicity. It defines the boundary of an action set, ensuring that generated explanations do not suggest impossible changes like decreasing a person's age or reversing a prior transaction.
Glossary
Feasibility Constraint

What is a Feasibility Constraint?
A feasibility constraint is a hard logical rule encoded into a counterfactual generation algorithm that prevents the modification of immutable features or enforces causal monotonicity.
These constraints are critical for generating actionable recourse. By integrating a causal graph or domain-specific rules, the algorithm respects real-world dependencies, such as preventing an increase in 'education level' without a corresponding increase in 'age.' This ensures the resulting counterfactual is not only valid but also executable by the end-user.
Core Characteristics of Feasibility Constraints
Feasibility constraints are the non-negotiable logical and physical rules encoded into counterfactual algorithms to ensure generated explanations are executable in the real world, not just mathematical artifacts.
Immutable Feature Masking
The most fundamental constraint prevents the algorithm from altering protected attributes that cannot be changed in reality. This includes:
- Demographic anchors: Age, birthplace, and ethnicity are held constant
- Temporal fixed points: Historical events or prior application dates remain static
- Genetic markers: Inherent biological characteristics are locked
The constraint is implemented as a binary mask vector that zeroes out gradients for immutable dimensions during the counterfactual search, ensuring the optimization path never traverses these axes.
Causal Monotonicity Enforcement
This constraint encodes the directional logic of real-world relationships to prevent nonsensical recommendations. It ensures that changes respect causal arrows defined in a structural causal model (SCM).
- Income cannot decrease when education increases: The constraint enforces a positive correlation
- Loan amount cannot exceed collateral value: A hard ceiling derived from business logic
- Age only moves forward: Temporal monotonicity prevents reversing time
Violating causal monotonicity produces implausible counterfactuals that destroy user trust and fail the actionable recourse test.
Action Set Boundary Definition
The action set formally specifies the permissible range and granularity of modifications for each mutable feature. This constraint transforms an unbounded optimization problem into a constrained search within a realistic manifold.
- Discrete constraints: Education level can only move between categories (High School → Bachelor's), not continuous values
- Budget constraints: Total feature change cost cannot exceed a user-defined threshold
- Legal ceilings: Interest rates capped at statutory maximums
The action set is the mathematical boundary between algorithmic recourse and useless fantasy.
Data Manifold Adherence
This constraint forces generated counterfactuals to lie within the high-density region of the training data distribution, preventing the algorithm from exploiting adversarial blind spots. It is operationalized through:
- Mahalanobis distance penalties: Weighting changes by the inverse covariance matrix to respect feature correlations
- Autoencoder reconstruction error: Rejecting instances that cannot be faithfully reconstructed by a model of the data manifold
- Density-based filtering: Using kernel density estimation to discard low-probability counterfactuals
Without this constraint, the algorithm may generate a plausible-looking but impossible individual that the model has never seen and cannot reliably classify.
Recourse Robustness Margin
A forward-looking constraint that requires counterfactuals to not just cross the decision boundary but to clear it by a specified margin. This hedges against model retraining drift.
- Prediction confidence threshold: The counterfactual must achieve a target probability (e.g., >0.7), not just >0.5
- Neighborhood stability check: Perturbations around the counterfactual must also yield the desired outcome
- Version-agnostic validity: Testing against an ensemble of retrained models to ensure the recourse remains actionable
This constraint directly addresses the CTO's concern that a recourse recommendation becomes invalid after the next model update cycle.
Sparsity as a Hard Constraint
While often treated as a soft objective, sparsity can be elevated to a hard feasibility constraint when cognitive load is a primary concern. The algorithm is restricted to modifying at most k features.
- k=3 for consumer-facing explanations: Humans struggle to process more than three simultaneous changes
- L0-norm penalty with Lagrangian multipliers: Enforcing exact sparsity through combinatorial optimization
- Feature grouping: Treating related features (e.g., all debt ratios) as a single change unit
This constraint acknowledges that an explanation requiring 15 simultaneous life changes is not a feasible plan—it is an overwhelming and useless directive.
Frequently Asked Questions
Explore the critical role of feasibility constraints in ensuring counterfactual explanations are not just mathematically valid, but also actionable and compliant with real-world logic.
A feasibility constraint is a hard, encoded rule within a counterfactual generation algorithm that restricts the search space to only realistic and actionable changes. It prevents the algorithm from suggesting modifications to immutable features (like age or birthplace) or violating known causal relationships (causal monotonicity). By defining the boundary of an action set, these constraints ensure that the generated explanation provides actionable recourse rather than a mathematically minimal but practically useless hypothetical scenario. They are the mechanism that bridges the gap between a theoretical data point and a real-world decision a human can execute.
Feasibility Constraints vs. Other Counterfactual Properties
How feasibility constraints differ from other properties enforced during counterfactual generation
| Property | Feasibility Constraint | Actionable Recourse | Plausible Counterfactual | Sparse Counterfactual |
|---|---|---|---|---|
Primary Objective | Enforce real-world immutability and causal monotonicity | Ensure changes are within user capability | Ensure instance lies in high-density data region | Minimize number of altered features |
Immutable Feature Handling | ||||
Causal Graph Required | ||||
Distance Metric Used | Causal distance or constrained L1/L2 | L1/L2 within action set | Mahalanobis distance | L0 norm |
Violation Consequence | Invalid counterfactual rejected | User cannot execute recourse | Adversarial or unrealistic instance | Harder to interpret |
Typical Enforcement Mechanism | Hard constraint in optimization | Action set definition | Density penalty in loss function | L0 regularization term |
Evaluated By | Constraint satisfaction rate | Action set coverage | Proximity to training manifold | Feature change count |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Understanding feasibility constraints requires context from the broader counterfactual and causal inference landscape. These concepts define the boundaries, metrics, and frameworks that make explanations actionable.
Actionable Recourse
The direct application of feasibility constraints in practice. Actionable recourse ensures that counterfactual recommendations only suggest changes to features an individual can realistically control.
- Filters out immutable features like age or ethnicity
- Respects monotonicity (e.g., education level cannot decrease)
- Translates mathematical constraints into human-readable guidance
Immutable Feature
A protected input attribute that feasibility constraints must hold constant during counterfactual generation. Modifying an immutable feature produces a technically valid but practically useless explanation.
- Examples: Place of birth, race, age at first credit event
- Encoded as zero-weight dimensions in distance metrics
- Violation breaks recourse feasibility entirely
Plausible Counterfactual
A counterfactual instance that lies within the high-density region of the training data distribution. Feasibility constraints alone cannot guarantee plausibility—the generated point must also be realistic.
- Measured via Mahalanobis distance to the data manifold
- Prevents adversarial examples that cross the decision boundary
- Ensures recommendations reflect real-world observations
Recourse Robustness
The property that a counterfactual recommendation remains valid even after model retraining or drift. Feasibility constraints must be designed to survive distribution shifts.
- A fragile recourse becomes invalid when the decision boundary moves
- Robust constraints account for model uncertainty
- Evaluated by testing counterfactuals against retrained model versions
Causal Graph
A directed acyclic graph (DAG) that visually encodes the causal assumptions feasibility constraints enforce. Nodes represent variables; edges represent direct causal influence.
- Prevents counterfactuals that reverse causal direction
- Encodes monotonicity constraints (e.g., age only increases)
- Used to derive valid adjustment sets for counterfactual inference

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us