AIML and Cybersecurity

Chapter 12
Explainable, Ethical and Human-Centered AI

Post Graduate Program in Cyber Security
AIML and Cybersecurity   •   Post Graduate

12. Explainable, Ethical and Human-Centered AI

Introduction and Context

Artificial intelligence is increasingly used to detect malicious activity, classify alerts, identify anomalous behaviour, prioritise vulnerabilities, support fraud investigations, and assist security analysts. These applications can process volumes and speeds beyond human capacity. Yet a technically accurate model is not automatically a trustworthy or appropriate decision-maker. In cybersecurity, an unexplained model may block legitimate users, expose sensitive groups to disproportionate scrutiny, or cause analysts to ignore important warnings. A model may also perform well in testing while failing when attackers deliberately manipulate inputs or when the operational environment changes.

Explainable, ethical and human-centered AI addresses this gap. Explainability concerns whether people can understand how an AI system reached or supports a result. Ethics concerns whether the system ought to be designed, deployed and used in a particular way. Human-centered design asks how AI can augment human judgment, preserve meaningful control and fit the social, organisational and professional context in which decisions occur.

These concerns are especially significant in cybersecurity because security decisions affect privacy, access, employment, reputation, safety and sometimes national security. The relevant question is therefore not simply, “Is the prediction accurate?” It is also, “For whom is it accurate, under what conditions, with what evidence, and subject to whose authority?”

Learning Objectives

After studying this chapter, a student should be able to:

  • distinguish interpretability, explainability, transparency, accountability and contestability;
  • compare major model-specific and model-agnostic explanation methods;
  • evaluate explanations using fidelity, stability, usefulness and security criteria;
  • identify sources of bias and assess fairness in cybersecurity AI;
  • design human-in-the-loop workflows with appropriate authority, escalation and override mechanisms;
  • analyse privacy, surveillance, accountability and analyst-trust concerns;
  • apply governance and responsible-use safeguards to an AI-enabled security system; and
  • critically evaluate an applied case involving explainable and ethical AI.

From Accurate Prediction to Justifiable Decision

Interpretability refers broadly to the extent to which a model’s operation can be understood by a person. A shallow decision tree, a sparse linear classifier or a rule-based detector is often considered intrinsically interpretable because its structure can be inspected directly. Explainability is a wider concept: it includes methods that produce understandable accounts of the behaviour of models that are otherwise difficult to inspect, such as deep neural networks or ensemble models.

Transparency may refer to openness about data sources, model purpose, system limitations, deployment conditions and decision processes. It does not necessarily mean publishing source code. Accountability concerns the allocation of responsibility for design, deployment, monitoring and consequences. Contestability means that affected persons can question, appeal or seek review of an AI-supported decision. These concepts overlap but are not interchangeable. A system can be transparent about its purpose yet provide poor explanations of individual decisions. It can provide explanations while still lacking a responsible person with authority to correct errors.

An explanation should be understood as an interface between a technical system and an audience. A security engineer may need feature contributions and confidence calibration; an analyst may need a concise evidence trail and recommended next actions; an executive may need aggregate risk, uncertainty and compliance implications; an affected employee may need to know what data was used and how to challenge an adverse decision. Consequently, there is no universally best explanation. Explanation quality depends on the decision, audience, timing and consequences.

A useful distinction is between global and local explanation. A global explanation describes the general behaviour of a model—for example, that unusual administrative privilege use, rare geographic access and high-volume data transfer are important predictors of account compromise. A local explanation addresses one instance—for example, why a particular login was classified as high risk. Global explanations support model validation and governance, while local explanations support investigation and review.

Explanations may be causal, descriptive or contrastive. A descriptive explanation reports associations used by the model. A causal explanation claims that changing a factor would change an outcome, which requires stronger evidence than correlation. A contrastive explanation answers a question such as, “Why was this event classified as malicious rather than benign?” Counterfactual explanations express what would need to be different for the decision to change. In security operations, contrastive and counterfactual explanations are useful, but they must not disclose information that helps an attacker evade detection.

Principal Explanation Approaches

Some models offer explanations through their own structure. Decision trees expose paths of conditions; linear models expose weighted features; rule systems expose explicit rules. Their apparent simplicity does not guarantee fairness or validity. A transparent model can encode biased labels, rely on proxy variables or be trained on incomplete data. Interpretability is therefore a property of the model’s representation, not proof of responsible use.

Model-agnostic methods treat the model as a black box and examine how its output changes when inputs are varied. Local surrogate methods approximate the model around a particular case using an interpretable model. Feature-attribution methods assign a contribution to each input feature, often relative to a baseline. Permutation-based techniques assess how performance changes when a feature is disrupted. Partial-dependence and accumulated-local-effect approaches describe average relationships between a feature and predictions. Counterfactual methods search for minimal changes that would produce a different result.

Each method has limitations. An attribution can be mathematically consistent while being difficult for a practitioner to interpret. A surrogate may fit one neighbourhood but misrepresent the original model elsewhere. Feature dependence can make an attribution unstable or misleading. Counterfactuals may recommend impossible or unethical changes, such as altering a person’s identity or withholding essential security information. Explanations can also be manipulated if an adversary learns precisely which thresholds to avoid.

Explanations should therefore be assessed using several criteria:

  • Fidelity: Does the explanation accurately represent the model’s actual reasoning or behaviour?
  • Stability: Do similar cases receive similar explanations, and does the explanation remain consistent across repeated runs?
  • Comprehensibility: Can the intended audience understand it without misleading simplification?
  • Actionability: Does it help the user decide what to investigate or do next?
  • Completeness: Does it identify material evidence, uncertainty and limitations?
  • Privacy and security: Does it avoid exposing personal data, sensitive infrastructure details or exploitable detection logic?

A confidence score is not an explanation. Nor is a list of the most important features sufficient if the system does not disclose whether those features were missing, imputed, correlated or outside their normal operating range. Good explanation interfaces should display uncertainty, data freshness, relevant evidence, model version and the scope within which the prediction is reliable.

Bias and Fairness in Cybersecurity AI

Bias is a systematic tendency that can produce inaccurate or inequitable outcomes. It may arise during problem formulation, data collection, labelling, feature engineering, model training, threshold selection, deployment or human interpretation. Historical incident records may reflect where an organisation monitored most heavily rather than where misconduct occurred. Labels may encode analysts’ past assumptions. A threat-intelligence dataset may overrepresent certain regions, languages, vendors or attack techniques. Security tools may collect richer telemetry from well-resourced departments than from contractors or remote workers.

Cybersecurity systems also create distinctive proxy risks. Device type, language, location, working hours or network origin may correlate with protected characteristics or socioeconomic conditions. A model that uses such variables may discriminate even when it does not explicitly use protected attributes. Removing a protected attribute does not remove bias if other variables reconstruct it.

Fairness is not a single metric. Depending on the context, designers may examine:

  • Demographic parity: whether positive decisions occur at similar rates across groups;
  • Equal opportunity: whether true-positive rates are similar across groups;
  • Equalised odds: whether true-positive and false-positive rates are similar across groups;
  • Predictive parity: whether a positive prediction has similar meaning across groups; and
  • Individual or similarity-based fairness: whether similar cases are treated similarly according to a justified definition of similarity.

These criteria can conflict, particularly when base rates differ. A governance team must therefore select fairness objectives based on the decision’s purpose, harms and legal context rather than choosing a metric because it produces a favourable report. In security, equal false-positive rates may be particularly important when alerts trigger intrusive investigations, while high sensitivity may be prioritised for critical infrastructure. The trade-off must be explicit and reviewed by relevant stakeholders.

Fairness assessment should be disaggregated by relevant groups and intersections, such as role, employment status, geography and accessibility needs. Aggregate accuracy can hide severe performance differences. Teams should examine error rates, calibration, abstention rates, investigation intensity and downstream consequences. Remediation may involve better sampling, improved labels, reweighting, threshold adjustment, human review, feature removal or redesign of the decision itself.

Human-in-the-Loop Security Decisions

Human-in-the-loop does not mean that a human is merely present somewhere in the process. Meaningful human oversight requires competence, time, information, authority and accountability. A reviewer who can only click “approve” under severe workload is performing rubber-stamp automation, not independent judgment.

A useful workflow distinguishes three levels of automation. In decision support, AI presents evidence while the analyst decides. In conditional automation, the system acts automatically for routine, low-impact cases and escalates uncertain or high-impact cases. In autonomous action, the system acts without immediate approval, usually within tightly bounded conditions and with rapid rollback. The appropriate level depends on reversibility, potential harm, uncertainty, attack exposure and operational urgency.

Effective workflows define:

1. Decision authority: who may approve blocking, account suspension, surveillance or disclosure;

2. Escalation rules: which confidence, impact or uncertainty conditions require specialist review;

3. Override mechanisms: how an authorised person can pause, reverse or modify an action;

4. Evidence requirements: what logs, alternative hypotheses and supporting data must be recorded;

5. Time limits: when a temporary automated action expires without human confirmation;

6. Feedback channels: how analysts report errors and how those reports affect improvement; and

7. Auditability: how decisions, explanations, versions and interventions are preserved.

Automation bias occurs when people over-trust machine recommendations. The opposite problem, algorithm aversion, occurs when users reject useful assistance after observing an error. Trust should be calibrated rather than maximised. Analysts need visibility into confidence, uncertainty, known failure modes, data quality and model performance by relevant context. Interfaces should encourage independent assessment by presenting evidence and alternatives, not merely a commanding label such as “threat.”

Human-centered design begins with field research. Designers should observe analysts’ workflows, alert fatigue, shift patterns, cognitive demands and escalation practices. Prototypes should be evaluated not only for accuracy but also for time to decision, error recovery, workload, comprehension, disagreement quality and the effect on less experienced staff. A system that improves benchmark accuracy but causes analysts to overlook rare attacks may be operationally harmful.

Surveillance, Privacy and the Scope of Legitimate Use

Security monitoring can become surveillance when data collection is excessive, persistent, opaque or repurposed beyond its legitimate objective. Behavioural analytics may infer sensitive information from browsing patterns, keystrokes, location, communications or social relationships. Even if collection is technically lawful, it may undermine dignity, autonomy and trust.

Responsible systems apply purpose limitation, data minimisation, retention controls, access restrictions and separation of duties. Organisations should identify the legitimate security objective, collect only necessary data, restrict secondary use and communicate monitoring practices in understandable language. Sensitive inferences should not be treated as established facts. Where possible, analysis should use aggregation, pseudonymisation or privacy-preserving techniques, while recognising that pseudonymised data may remain re-identifiable.

Privacy and security can conflict. Detailed telemetry can improve detection, but broad access to that telemetry increases misuse and breach risk. Explanations can support accountability but disclose personal or operational information. A balanced design uses role-based explanation, redaction, secure audit trails and controlled disclosure. High-impact monitoring should undergo a privacy and human-rights impact assessment before deployment.

Accountability and Governance Across the AI Lifecycle

Accountability must be distributed across the lifecycle rather than assigned only after an incident. Product owners define purpose and acceptable use. Data stewards document provenance and quality. Model developers test performance and robustness. Security teams evaluate adversarial risks. Legal, privacy and compliance specialists assess obligations. Operational managers define escalation and resourcing. Senior leadership accepts residual risk. Independent assurance functions audit claims and controls.

A practical governance record should include the system’s intended purpose, prohibited uses, affected populations, data sources, labelling method, model version, evaluation results, known limitations, fairness analysis, explanation method, security controls, approval authority and monitoring plan. Model cards, datasheets and decision logs can support this record, but documentation must be maintained as the system changes.

Lifecycle governance includes pre-deployment validation, controlled release, continuous monitoring, incident response and retirement. Monitoring should detect data drift, concept drift, changes in attack behaviour, performance degradation, subgroup disparities, explanation instability, alert-volume changes and override patterns. A model should be retrained or withdrawn when its operating assumptions no longer hold. Versioning is essential: investigators must be able to determine which model, data and configuration produced a past decision.

A responsible-use policy should prohibit uses that exceed the system’s validated purpose, prevent discriminatory profiling, require human review for high-impact decisions and establish sanctions for misuse. Procurement should require vendors to disclose evaluation evidence, update practices, security responsibilities, incident notification procedures and audit rights. “The vendor’s model is proprietary” is not a sufficient reason to deny an organisation the information needed to assess risk.

Applied Case: Sentinel Account Defence

Background

The following is an illustrative case. A large university deploys Sentinel, an AI system intended to identify compromised staff and student accounts. It combines login geography, device characteristics, authentication failures, access to unusual repositories and data-transfer patterns. Sentinel assigns a risk score and may temporarily require additional authentication.

Situation and Problem

During the first semester, the system reduces successful account takeovers but generates substantially more alerts for international students, travelling researchers and staff who use privacy-enhancing network services. Analysts begin to treat high scores as proof of compromise. Several users are temporarily locked out before urgent examinations and research deadlines. The university cannot initially explain why specific accounts were selected because the dashboard displays only a score and a generic label.

Analysis

An investigation finds that historical labels were based on previous analyst escalations. Since analysts had historically examined unfamiliar foreign logins more aggressively, the training data reflected monitoring intensity rather than confirmed compromise. “Country rarity” and “unusual time” acted as proxies for legitimate mobility and work patterns. The model also treated missing device information as suspicious, although privacy controls and older devices caused missingness. A global feature-importance report did not reveal these local effects.

The governance review identifies four risks: unequal false positives, automation bias, insufficient contestability and privacy overreach. It also notes that immediate account suspension is a high-impact and partly irreversible action, whereas step-up authentication is more proportionate and reversible.

Approach and Safeguards

The university first separates detection from enforcement. Sentinel can recommend step-up authentication, but automatic suspension requires human approval except for narrowly defined emergency conditions. The team creates a confirmed-incident label process, distinguishes investigation from confirmed compromise, and evaluates performance across relevant user groups and work contexts.

The dashboard is redesigned to show the principal evidence, data freshness, uncertainty, missing inputs, model version and alternative explanations. Analysts are instructed to consider at least one benign hypothesis before escalation. Users receive a plain-language notice explaining the reason for additional verification and a rapid appeal route. An independent security officer can reverse an action, and temporary controls expire unless renewed.

The team removes country rarity as a direct enforcement feature, adds legitimate travel and research context where appropriately governed, and treats missingness explicitly rather than automatically as suspicious. Monitoring tracks false positives, appeal outcomes, subgroup effects, analyst overrides and changes in attack patterns. Access to detailed personal data is limited by role, and audit logs record every inquiry.

Outcome

In this illustrative case, the revised system produces fewer unnecessary lockouts and improves the quality of analyst investigations. Its value is not measured only by a change in detection accuracy. The university also gains a defensible explanation process, clearer responsibility, better user recourse and evidence for deciding when automation should be limited. Some residual disparities remain, so governance continues rather than ending at deployment.

Learning Points

The case demonstrates that fairness problems can originate in labels and operational practices, not only in algorithms. It also shows why a score is not a decision, why proportional responses matter, and why human oversight requires authority and time. Explainability, privacy, fairness and security are interdependent: a more informative explanation can improve review but must be designed so that it does not expose sensitive data or detection logic.

Challenges and Common Mistakes

A frequent mistake is treating explainability as a cosmetic dashboard feature. An attractive chart cannot compensate for invalid labels, poor calibration or an inappropriate objective. Another is assuming that a high-performing model is fair. Accuracy can conceal subgroup failures and harmful downstream decisions.

Teams also confuse correlation with causation, use unstable explanations without testing them, and present confidence as certainty. They may evaluate fairness only before deployment, ignore intersectional groups, or rely on a single metric despite conflicting objectives. Human review is sometimes added after the system is built, without redesigning workloads or giving reviewers authority to disagree.

Security-specific mistakes include exposing detection thresholds to adversaries, allowing explanations to leak personal data, failing to test evasion and poisoning attacks, and allowing feedback loops to reinforce historical suspicion. Over-collection of telemetry creates both privacy and breach risks. Finally, vague responsibility causes organisations to blame “the algorithm” after an adverse event, even though people selected the objective, approved deployment and controlled the response.

Current Developments and Responsible Practice

Current work increasingly combines interpretable models with post-hoc explanation, uncertainty estimation, causal analysis, privacy-preserving learning and robust evaluation. Federated and privacy-enhancing approaches may reduce centralised data exposure, although they introduce new governance and security challenges. Generative AI is being used to summarise alerts and produce analyst-facing explanations, but generated narratives must be grounded in logged evidence and clearly marked as machine-produced. A fluent explanation is not necessarily a faithful one.

Responsible practice can be expressed as a continuous cycle: define a legitimate purpose; map affected stakeholders; assess risks and alternatives; establish data and model documentation; validate accuracy, fairness, robustness and explanation quality; pilot with trained users; deploy proportionate controls; monitor outcomes; investigate complaints and incidents; and retire or redesign the system when assumptions fail.

The central professional principle is proportionality. The more a system can affect rights, access, privacy or livelihood, the stronger the requirements for evidence, human review, explanation, contestability and independent oversight. In cybersecurity, responsible AI is not an obstacle to protection. It is a condition for protection that remains legitimate, reliable and trusted under pressure.

Best Practices for Practitioners

  • Define the security decision and its acceptable consequences before selecting a model.
  • Prefer the simplest model that meets the validated operational requirement.
  • Document data provenance, labels, missingness, proxies and known exclusions.
  • Evaluate performance, calibration and errors across relevant and intersecting groups.
  • Use explanations that are faithful, audience-appropriate, actionable and safe to disclose.
  • Display uncertainty, data quality, model version and limitations alongside recommendations.
  • Make human review meaningful through authority, training, time and escalation procedures.
  • Use reversible and proportionate interventions before severe enforcement actions.
  • Provide notice, appeal and correction mechanisms where people are affected.
  • Monitor drift, fairness, overrides, complaints and adversarial manipulation after deployment.
  • Preserve decision and explanation logs with appropriate privacy and access controls.
  • Assign named accountability and review vendor claims rather than accepting opaque assurances.

Chapter Summary

Explainable, ethical and human-centered AI extends cybersecurity evaluation beyond predictive accuracy. Interpretability concerns understanding model operation, while explainability provides audience-specific accounts of decisions. Global, local, counterfactual and feature-attribution methods can support validation and investigation, but each has fidelity, stability, privacy and security limitations. Fairness must be assessed across relevant groups and linked to the harms of false positives and false negatives. Human-in-the-loop design requires genuine authority, evidence, escalation, override and accountability rather than superficial approval. Privacy, surveillance, contestability and lifecycle governance are essential because security AI can affect access, dignity and reputation. Responsible deployment therefore combines technical evaluation with organisational controls, proportional interventions, continuous monitoring and clear responsibility.

Key Terms

Interpretability: The extent to which a model’s operation can be understood directly.

Explainability: The use of methods or representations that communicate how an AI system produces an output.

Transparency: Openness about a system’s purpose, data, operation, limitations and governance.

Accountability: The assignment of responsibility for AI design, decisions, impacts and remediation.

Contestability: The ability of affected persons to question, appeal or seek review of an AI-supported decision.

Global explanation: An account of a model’s general behaviour across cases.

Local explanation: An account of why a model produced a result for a particular case.

Counterfactual explanation: A statement of what changes could produce a different outcome.

Fidelity: The degree to which an explanation accurately represents the model’s behaviour.

Calibration: The agreement between predicted probabilities and observed outcome frequencies.

Bias: A systematic tendency that produces inaccurate or inequitable results.

Demographic parity: A fairness criterion requiring similar positive-decision rates across groups.

Equal opportunity: A fairness criterion requiring similar true-positive rates across groups.

Automation bias: Excessive reliance on an automated recommendation.

Human-in-the-loop: A design in which human judgment participates meaningfully in an AI-supported process.

Data drift: Change in the distribution of input data over time.

Concept drift: Change in the relationship between inputs and the target outcome.

Purpose limitation: Restricting data use to specified, legitimate objectives.

Proportionality: Matching the intrusiveness and severity of action to the risk and evidence.

Model card: A document describing a model’s purpose, performance, limitations and appropriate use.

Review Questions

Short Answer Questions

1. Distinguish interpretability from explainability.

2. What is the difference between a global and a local explanation?

3. Why does removing a protected attribute not necessarily eliminate bias?

4. Define automation bias in a cybersecurity workflow.

5. What information should be included in an AI decision log?

Long Answer Questions

1. Explain the principal methods used to interpret complex AI models and discuss their limitations.

2. Discuss how fairness should be evaluated in an AI-based security monitoring system.

3. Explain the requirements for meaningful human-in-the-loop decision-making.

4. Analyse the relationship between explainability, privacy and adversarial security.

5. Describe a lifecycle governance framework for responsible deployment of cybersecurity AI.

Analytical / Application Questions

1. A model flags remote workers at twice the rate of office-based workers, but the confirmed compromise rate is similar. Analyse possible causes and recommend corrective action.

2. Design an escalation policy for an AI system that detects suspected insider threats, distinguishing reversible from high-impact actions.

3. An analyst dashboard shows a high-risk score but no evidence, uncertainty or model version. Evaluate the risks and propose a redesigned interface.

22. Multiple Choice Questions with Answers

Question 1

Which statement best distinguishes a local explanation from a global explanation?

A. A local explanation describes the model’s average performance across all groups.

B. A local explanation explains why a particular case received a specific output.

C. A local explanation exposes the complete source code of the model.

D. A local explanation proves that the model’s decision is causal.

Correct Answer: B. A local explanation explains why a particular case received a specific output.

Question 2

A security model has high overall accuracy but a much higher false-positive rate for contractors. What is the most appropriate first response?

A. Deploy it unchanged because aggregate accuracy is high.

B. Remove all demographic information and stop evaluation.

C. Disaggregate performance and investigate data, labels, features and operational causes.

D. Increase the threshold for every user equally without further analysis.

Correct Answer: C. Disaggregate performance and investigate data, labels, features and operational causes.

Question 3

Which feature most clearly indicates meaningful human oversight?

A. A human can approve an AI recommendation only by clicking a required button.

B. The system hides uncertainty so that analysts are not confused.

C. An authorised reviewer can examine evidence, disagree, reverse an action and record the reason.

D. The model automatically suspends every account above a fixed score.

Correct Answer: C. An authorised reviewer can examine evidence, disagree, reverse an action and record the reason.

Question 4

Why may a counterfactual explanation be unsafe in a cybersecurity system?

A. It always requires a decision tree.

B. It can reveal thresholds or conditions that help an attacker evade detection.

C. It cannot be understood by security engineers.

D. It measures only aggregate accuracy.

Correct Answer: B. It can reveal thresholds or conditions that help an attacker evade detection.

Question 5

Which practice best addresses automation bias?

A. Presenting the model output as an unquestionable final decision.

B. Removing all explanations to prevent analyst disagreement.

C. Providing evidence, uncertainty, alternative hypotheses and authority to override.

D. Allowing only senior managers to see model results.

Correct Answer: C. Providing evidence, uncertainty, alternative hypotheses and authority to override.

Question 6

A model explanation changes substantially for nearly identical events. Which quality criterion is most directly affected?

A. Stability

B. Purpose limitation

C. Demographic parity

D. Data minimisation

Correct Answer: A. Stability

Question 7

Which response is most proportionate when an AI system detects a moderately suspicious login but evidence is incomplete?

A. Permanent account deletion without review.

B. Publicly identifying the user as malicious.

C. Temporary step-up authentication with human review and an appeal route.

D. Ignoring the alert because uncertainty exists.

Correct Answer: C. Temporary step-up authentication with human review and an appeal route.

Question 8

In the Sentinel case, why were historical analyst escalations problematic as training labels?

A. They contained no numerical values.

B. They reflected monitoring and investigation practices, not necessarily confirmed compromise.

C. They prevented the model from using any geographic information.

D. They guaranteed equal error rates across groups.

Correct Answer: B. They reflected monitoring and investigation practices, not necessarily confirmed compromise.

Question 9

Which governance measure is most important for reconstructing a past AI-supported decision?

A. Deleting old model versions after deployment.

B. Recording the model version, inputs, output, explanation and human intervention.

C. Allowing only the vendor to retain system records.

D. Replacing all logs with aggregate monthly accuracy.

Correct Answer: B. Recording the model version, inputs, output, explanation and human intervention.

Question 10

Why is a confidence score alone not an adequate explanation?

A. Confidence scores are always inaccurate.

B. It does not show the evidence, uncertainty sources, limitations or reasoning relevant to the decision.

C. Confidence scores can be used only with linear models.

D. It automatically violates privacy law.

Correct Answer: B. It does not show the evidence, uncertainty sources, limitations or reasoning relevant to the decision.

AIML and Cybersecurity
Chapter 12 of 14