An immutable feature is a protected input attribute, such as age, place of birth, or a protected class characteristic, that is logically or legally impossible for an individual to change. In the context of counterfactual explanations and algorithmic recourse, these features must be held constant during generation to ensure that the recommended changes are realistic and do not violate fundamental constraints of the real world.
Glossary
Immutable Feature

What is Immutable Feature?
An immutable feature is a protected input attribute that cannot be changed and must be held constant when generating counterfactual explanations.
Enforcing immutability is a critical feasibility constraint within recourse systems. If a counterfactual algorithm suggests altering an immutable feature to achieve a favorable outcome, the resulting explanation is not actionable. Therefore, formal action sets explicitly define immutable features to restrict the search space, ensuring that generated counterfactuals only propose modifications to mutable attributes, thereby providing legally defensible and practically useful guidance to end-users.
Key Characteristics of Immutable Features
Immutable features are protected input attributes that cannot be altered by an end-user and must be held constant during counterfactual generation to ensure algorithmic recourse is realistic and non-discriminatory.
Definition and Core Principle
An immutable feature is an input attribute whose value is fixed by nature, law, or logic and cannot be changed through user action. In counterfactual explanation systems, these features act as hard constraints—the algorithm is forbidden from suggesting changes to them. Classic examples include date of birth, place of birth, genetic markers, and historical events. The core principle is that a counterfactual that says 'you would have been approved if you were 10 years younger' is not actionable and therefore provides no meaningful recourse.
Distinction from Protected Attributes
While overlapping, immutable features and protected attributes (under fairness law) are not identical sets:
- Immutable features: Cannot be changed physically or logically (e.g., birth year, native language)
- Protected attributes: Legally shielded from discrimination (e.g., race, gender, religion)
- Key difference: Some protected attributes may be mutable (e.g., marital status, religion), while some immutable features may not be legally protected (e.g., astrological sign). Counterfactual systems must respect both categories, but immutability is a physical/logical constraint, not a legal one.
Role in Algorithmic Recourse
Immutable features define the boundary of an action set—the space of permissible feature modifications available to a user. When generating counterfactuals:
- The algorithm must mask out immutable features from perturbation
- The search for a counterfactual occurs only in the subspace of mutable features
- If no valid counterfactual exists without altering an immutable feature, the system should report no feasible recourse rather than suggesting an impossible change. This constraint is critical for recourse feasibility and distinguishes actionable explanations from purely diagnostic ones.
Causal Dependencies and Downstream Effects
Immutable features often serve as root nodes in causal graphs, exerting downstream influence on mutable features. For example, age (immutable) causally affects years of experience (mutable). A naive counterfactual system might suggest increasing experience without recognizing that age constrains the maximum plausible value. Advanced systems encode these dependencies through structural causal models (SCMs) and feasibility constraints that prevent counterfactuals from violating causal monotonicity—ensuring the recommended change respects the immutable feature's causal influence on other variables.
Implementation in Counterfactual Algorithms
Immutable features are enforced through several technical mechanisms:
- Feature masking: Zeroing out gradients for immutable dimensions during gradient-based generation
- Constraint optimization: Adding hard equality constraints to the objective function (e.g.,
x_immutable == x_original) - Action set specification: Defining a binary mask vector where
1indicates mutable and0indicates immutable - Post-hoc filtering: Generating candidates freely, then discarding any that modify immutable features. The masking approach is preferred as it is computationally efficient and guarantees constraint satisfaction during the search process.
Evaluation and Fairness Implications
The handling of immutable features directly impacts counterfactual fairness. A model is counterfactually fair if its prediction for an individual is identical to its prediction in a counterfactual world where only a sensitive, immutable attribute (e.g., race) is changed. Violations indicate the model relies on protected immutable features. Evaluation metrics include:
- Constraint violation rate: Percentage of generated counterfactuals that improperly alter immutable features
- Recourse rate by group: Whether protected groups have systematically lower access to actionable recourse due to immutable feature constraints
- Causal fairness gap: Difference in predictions between actual and counterfactual selves
Frequently Asked Questions
Explore the critical role of immutable features—protected attributes that cannot be altered—in generating realistic and actionable counterfactual explanations for algorithmic recourse and fairness auditing.
An immutable feature is a protected input attribute that represents a fixed, unchangeable characteristic of an individual or entity and must be held constant when generating counterfactual explanations. Unlike actionable features such as income or loan amount, immutable features like age, place of birth, race, or gender cannot be modified in the real world. In the context of algorithmic recourse, counterfactual generation algorithms must explicitly encode these features as hard constraints to prevent the system from recommending impossible changes—for example, suggesting a loan applicant 'be younger' to qualify. The formal specification of immutable features is typically defined within an action set, which partitions the feature space into mutable and non-mutable dimensions. Violating immutability constraints produces infeasible recourse that undermines user trust and may violate anti-discrimination regulations such as the Equal Credit Opportunity Act.
Examples of Immutable Features by Domain
Immutable features are input attributes that cannot be changed in the real world and must be held constant during counterfactual generation. The following examples illustrate how these protected fields manifest across different industries.
Financial Lending
In credit decisioning, immutable features form the backbone of regulatory compliance. Age and date of birth are classic immutable attributes that cannot be altered in a recourse recommendation—you cannot tell an applicant to be older to qualify for a loan. Similarly, country of origin and historical bankruptcy filings are temporally fixed. A valid counterfactual for a denied loan must hold these constant while suggesting changes to mutable features like credit utilization ratio or number of open accounts.
Healthcare Diagnostics
Medical counterfactuals must respect biological immutability. Genetic markers such as BRCA1/BRCA2 mutation status are fixed at birth and cannot be modified. Family medical history is a temporally immutable record—a patient cannot retroactively change their parents' health outcomes. When generating explanations for a disease risk prediction, the system must hold these features constant and instead explore changes to BMI, smoking status, or medication adherence to flip the prediction.
Employment & Hiring
Algorithmic hiring tools must treat several features as immutable to avoid discriminatory recourse. Race, gender, and ethnicity are legally protected and biologically fixed. Educational pedigree—the specific institution attended—is temporally immutable once a degree is conferred. A counterfactual explaining why a candidate was rejected must not suggest changing their alma mater. Instead, it should focus on actionable features like years of experience, certification status, or skill endorsements.
Criminal Justice & Recidivism
Recidivism prediction models operate under strict immutability constraints. Prior conviction count and age at first offense are historical facts that cannot be altered. Place of birth and juvenile record status are similarly fixed. Counterfactual explanations for a high-risk classification must hold these constant while identifying mutable pathways such as employment status, substance abuse treatment completion, or housing stability to demonstrate what would change the assessment.
Insurance Underwriting
Actuarial models rely on several immutable features that counterfactuals must preserve. Date of first license issuance is a fixed historical timestamp. Congenital conditions present from birth cannot be reversed. Natural disaster zone classification for a property is geographically immutable. When explaining a premium denial, the system must not suggest relocating a house. Valid recourse focuses on installing safety systems, bundling policies, or increasing deductibles.
Education & Admissions
University admission models must respect temporal immutability. High school GPA is a sealed record that cannot be retroactively improved. Standardized test scores from past sittings are fixed data points. Socioeconomic background and first-generation student status are immutable demographic facts. Counterfactual explanations for a rejection must hold these constant and instead highlight changes to personal statement quality, extracurricular depth, or interview performance as actionable recourse paths.
Immutable vs. Mutable Features in Recourse
A comparison of how immutable and mutable features are treated during counterfactual generation and their impact on actionable recourse.
| Characteristic | Immutable Features | Mutable Features |
|---|---|---|
Definition | Attributes that cannot be changed by the individual or system | Attributes that can be realistically modified by the individual |
Modification in Counterfactuals | ||
Examples | Age, place of birth, ethnicity, gender (in many jurisdictions) | Income, savings amount, number of prior claims, education level |
Role in Recourse | Held constant as hard constraints during generation | Perturbed to find minimal changes that flip the prediction |
Constraint Type | Feasibility constraint (hard, inviolable) | Actionable within defined action set bounds |
Violation Consequence | Generates infeasible, legally non-compliant recourse | May produce unrealistic recommendations if unconstrained |
Causal Relationship | Often root nodes in causal graphs with no incoming edges | May have causal parents that must be respected during perturbation |
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
Core concepts that interact with immutable features when generating valid and actionable counterfactual explanations.
Action Set
A formal specification of the permissible modifications a user can make to each feature, defining the boundary between actionable and non-actionable changes. The action set explicitly marks immutable features as frozen, ensuring the counterfactual search algorithm never suggests altering them. This specification is critical for recourse feasibility and is often encoded as a set of inequality constraints or a binary mutability mask.
Recourse Feasibility
The degree to which a counterfactual recommendation respects real-world constraints, including immutable features, causal relationships, and user capabilities. A feasible counterfactual never suggests changing a protected attribute like race or birth_year. Instead, it operates entirely within the action set, ensuring the path to a favorable outcome is both logically sound and practically achievable by the end-user.
Plausible Counterfactual
A counterfactual instance that lies within the high-density region of the training data distribution, ensuring the explanation is realistic and not an adversarial artifact. Plausibility constraints often implicitly respect immutable features by preventing the generation of instances that violate known data manifolds—for example, a 20-year-old with 30 years of professional experience would be flagged as implausible and rejected.

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