AWS Builder Center
Don't Let an LLM Decide Who Gets Welfare: AI for Language, Rules for Eligibility with Amazon Bedrock and Amazon Polly

Don't Let an LLM Decide Who Gets Welfare: AI for Language, Rules for Eligibility with Amazon Bedrock and Amazon Polly

Large language models are great at conversation but poor choices for eligibility decisions. Here's how we built a welfare-assistance system where Amazon Bedrock handles language, deterministic rules handle eligibility, and Amazon Polly provides accessible read-aloud explanations.

Software Developer

Don't Let an LLM Decide Who Gets Welfare: AI for Language, Rules for Eligibility

When people talk about AI in public services, they often jump straight to automation.
A chatbot answers questions.
A language model processes applications.
An AI assistant tells citizens whether they qualify for a government scheme.
That's where I think many teams make a dangerous mistake.
Large Language Models are excellent at understanding language.
They are not the right place to decide who receives welfare benefits.
This distinction shaped the architecture of our system.
We used Amazon Bedrock for language.
We used deterministic rules for eligibility.
And we used Amazon Polly to make those decisions accessible through speech.
That separation ended up being one of the most important technical decisions in the project.



The Risk Nobody Talks About

Imagine a family applying for financial assistance.
They open a chatbot and ask:
"Can I get this scheme?"
The AI reads their message and replies:
"You do not qualify."
The family trusts the answer.
They stop applying.
Months later they discover they were actually eligible.
The problem isn't that the AI was malicious.
The problem is that it sounded confident.
Language models are designed to generate plausible responses.
They are not designed to be the source of truth for legal, financial, or welfare eligibility.
Even a small error can affect real people.
That's why we decided the LLM would never make eligibility decisions.



Our Architecture Rule

We adopted a simple principle:
AI explains decisions. Rules make decisions.
Every eligibility outcome comes from deterministic business logic.
The language model never decides.
It only translates and explains.
Architecture:
User
↓
Eligibility Engine
↓
Decision
↓
Amazon Bedrock
↓
Explanation
↓
Amazon Polly
↓
Voice Output
The source of truth remains the eligibility engine.



How Eligibility Works

Instead of asking an LLM:
Is this person eligible?
we ask code.
Example:
const eligible =
annualIncome <= 300000 &&
age >= 18 &&
state === "Tamil Nadu";
The result is deterministic.
Given identical inputs:
Input A → Output A
every time.
No randomness.
No prompt variation.
No model updates changing outcomes.



Predicate-Based Rules

We represent schemes as predicates.
Example:
{
id: "farmer-assistance",
conditions: [
{
field: "annualIncome",
operator: "<=",
value: 300000
},
{
field: "age",
operator: ">=",
value: 18
}
]
}
Evaluation becomes straightforward:
const result = evaluateScheme(
scheme,
applicantData
);
This creates a clear separation:
  • Rules determine outcomes
  • AI explains outcomes



Why This Matters

A rules engine provides something an LLM cannot guarantee.
Consistency.
The same applicant receives the same result every time.
No prompt engineering required.
No temperature tuning.
No model-specific behavior.
Just predictable logic.



Auditability

The second benefit is auditability.
Every decision can be traced.
Example:
{
"scheme": "farmer-assistance",
"result": false,
"failedRule": "annualIncome",
"expected": "<=300000",
"actual": 320000
}
This creates a complete audit trail.
Months later you can answer:
  • Which rule failed?
  • What data was used?
  • Why was the decision made?
That's extremely difficult when the decision originates inside a language model.



Near-Miss Explanations

One of the most useful features came from this architecture.
Because the rules engine knows exactly why someone failed, we can explain the gap.
Instead of:
Not eligible.
we can provide:
Not eligible.

Your annual income exceeds
the scheme limit by ₹20,000.
Or:
You meet 4 of 5 requirements.

Age requirement not satisfied.
Minimum age is 18.
These explanations help citizens understand what happened.
And they come directly from rule evaluation.
Not from AI guesswork.



Decision Log Example

A typical decision log looks like:
{
"timestamp": "2026-09-20T10:15:00Z",
"scheme": "education-support",
"result": false,
"checks": [
{
"field": "income",
"passed": false,
"expected": "<=200000",
"actual": 220000
},
{
"field": "age",
"passed": true
}
]
}
This can be stored, reviewed, tested, and audited.
Every outcome has evidence.



Where Amazon Bedrock Fits

Once the eligibility engine produces a result, Amazon Bedrock takes over.
Example:
{
"eligible": false,
"reason": "Income exceeds limit by ₹20,000"
}
Bedrock receives structured data.
Not raw authority to decide.
Prompt:
Explain this result to the user
in simple Hindi.
Bedrock becomes a language layer.
It helps users understand decisions.
It does not create them.
This architecture also allows provider flexibility.
Today:
Amazon Bedrock
Tomorrow:
Another provider
The rules engine remains unchanged.



Where Amazon Polly Fits

Accessibility was equally important.
Many users prefer listening over reading.
Amazon Polly converts the explanation into speech.
Example:
You are not eligible because
your annual income exceeds
the limit by ₹20,000.
becomes:
Natural spoken audio
This makes the system accessible to:
  • Low-literacy users
  • Elderly citizens
  • Mobile-first users
  • Regional-language audiences
Again, Polly explains.
It does not decide.



The Provider Independence Benefit

Another advantage emerged unexpectedly.
Because eligibility lives outside the AI model:
Rules Engine
remains the source of truth.
Changing from:
Bedrock
to another provider requires only:
Configuration changes
The decision logic never changes.
This reduces vendor lock-in and makes long-term maintenance easier.



Final Thoughts

Large Language Models are powerful.
But power does not mean responsibility should be delegated to them.
For welfare, grants, subsidies, financial assistance, and eligibility systems:
  • AI should understand language.
  • AI should explain outcomes.
  • AI should improve accessibility.
  • AI should not decide eligibility.
That responsibility belongs to transparent, testable, auditable rules.
Our architecture reflects that principle:
Rules decide.
AI explains.
Amazon Bedrock handles conversation.
Amazon Polly handles accessibility.
The eligibility engine remains the source of truth.
And that separation gives us something every public-facing system needs:
Consistency, accountability, and trust.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article