AI ethics focuses on how AI-powered applications affect people. It examines how risks and benefits are distributed, and how these applications remain aligned with user expectations and social responsibilities over time. This includes fairness, non-discrimination, transparency, explainability, accountability, and governance. In this topic, we cover the key moral principles and values to consider when building AI-powered applications and agents.
Data protection and privacy safeguards
AI-powered applications routinely process personally identifiable information (PII) and proprietary content. Third-party providers can use sensitive data in inputs to refine future model versions, which poses a major privacy risk. You need mechanisms to detect and mask sensitive data in both inputs and outputs. You also need to limit what gets stored in logs and conversation history.
Libraries like LLM Guard provide ready-made scanners for this purpose. For example, you can scan a user prompt for sensitive data before it reaches the model:
from llm_guard.input_scanners import Anonymize
from llm_guard.vault import Vault
vault = Vault()
scanner = Anonymize(vault=vault)
sanitized_prompt, is_valid, risk_score = scanner.scan("", user_prompt)The Anonymize scanner detects entities such as names, email addresses, and phone numbers, replaces them with placeholders, and stores the originals in a vault so you can de-anonymize them later as needed. This type of deterministic check runs before the model ever sees the input.
If your application uses retrieval-augmented generation (RAG), add permission-aware retrieval to ensure the model never fetches documents the current user isn't authorized to see. Additionally, you need to build safe fallbacks for low-confidence or missing-context situations, and ensure the system communicates clearly when it can't reliably complete a request.
Bias and accessibility
Fairness and non-discrimination mean your application treats people consistently across demographic groups and use-case contexts. Bias in models typically enters through training data that reflects historical inequalities, algorithmic design choices, or even the way humans label data. To achieve fairness, apply deliberate approaches at each phase of the development lifecycle: training, fine-tuning, integration, and deployment.
If you can train or fine-tune a model, use a diverse dataset that reflects users from different demographic groups, genders, ages, and abilities. You should ensure that the groups are equally represented and avoid over- or underfitting as the model learns. This also applies to evaluation—your test sets should mirror your actual user population, not just ideal inputs.
During integration and development, ensure that you develop algorithms and use models that are fair and properly mitigate bias. Then, test with a diverse dataset. Check whether the system produces different quality, tone, or outcomes for different groups. When you find inconsistencies, update training data, prompts, or retrieval logic.
In terms of accessibility, your application should be usable by people with different abilities and in different environments. Support screen readers and other assistive technologies, and offer multiple input and output modalities where possible.
Transparency and explainability
Transparency and explainability require that users know they're interacting with an AI-powered system and understand what it can and can't do. A system card that states the intended use, known limitations, failure modes, and data-handling rules is very useful here. If your system uses retrieval, the card should explain when retrieval is invoked and what access controls apply. Good documentation is a safety mechanism that prevents misuse rooted in misunderstanding.
As reasoning models and agentic systems become mainstream, another critical transparency practice is exposing the system's chain of thought and intermediate steps. When a reasoning model solves a problem, showing the sequence of logical steps, hypotheses considered, and conclusions drawn lets users verify how an answer was reached.
Similarly, when an AI agent orchestrates a multi-step workflow (calling tools, querying APIs, reading files), each step should be logged and available for inspection. For end users, this means showing them summarized reasoning chains and actions taken in the UI. Citations and other grounding signals should also be provided when document retrieval or web search is used. This allows users to check the sources themselves.
For effective transparency and explainability, observability tools and frameworks are key. They help you trace prompts, retrieved context, tool calls, and final outputs. If you can't trace how the model reached an output, you can't debug issues, reproduce failures, or demonstrate that the system stayed within policy.
AI governance
Governance is the organizational structure that keeps responsible AI practices consistent over time. This means implementing policies and regulations to enforce responsible AI practices. Data privacy laws, such as the General Data Protection Regulation (GDPR), enforce strict data processing standards with penalties for non-compliance.
Accountability is equally important. Someone must own the outcomes the system produces, not just the code that powers it. Organizations should define clear owners for each capability and set up escalation paths for edge cases. When an agentic system autonomously calls an API that modifies production data, "the model did it" isn't an acceptable answer—a named team or individual must be accountable for enabling that action and for the policy that allowed it.
Accountability also means establishing who has the authority to make critical decisions about system behavior. When the model must choose between competing goals—helpfulness versus safety, personalization versus privacy, speed versus accuracy—those trade-offs should be carefully considered. This involves deliberate, cross-functional decision-making involving senior leadership, engineering, legal, product, and domain experts. Then, those decisions and the reasoning behind them should be documented so they can be revisited as circumstances change.
Compliance translates external requirements—consent rules, data-retention policies, sector-specific regulations—into concrete system behavior. This means limiting data collection to what is necessary, defining retention windows, and enforcing rules around what the system can generate or store. If your domain has additional constraints (for example, medical-device regulations or financial-reporting standards), you build those directly into the workflow. Where possible, encode compliance as automated checks—policy-as-code that rejects disallowed outputs or flags missing consent is far more reliable than a manual review cycle.
Finally, governance must include mechanisms for redress. Users and affected parties need a clear path to report problems, challenge outputs, and request human review. If a model flags content for removal, the people on the receiving end should be able to ask "why?" and reach a human who can override the decision.
Conclusion
Ethical considerations in AI development are sensitive and carry significant implications. As you design and manage AI-powered applications, embracing these considerations is fundamental to your role. Remember, ethical AI demands ongoing attention and commitment to evolving standards, contexts, and societal expectations.