#10031 Add AI-assisted policy evaluation backend to Expense Agent
Expense Agent now supports AI-assisted policy evaluation, storing immutable evaluation results for each policy and expense report subject, with new tables, pages, and APIs to track compliance status and enable policy validation at approval.
- 54files
- 46AL files
- 46objects
Pull request · merged into main (BC30) on 2026-08-21 by encimita · 54 files (+4067 -15), 46 AL · feature · tier official · reviewed (checked by Opus)
What changed
- New Expense Policy Evaluation table stores one immutable result per subject version and policy version, including the policy snapshot, reason, verdict and timestamp
- Expense report lines show a policy status: No Policies, Not Evaluated, Needs Recheck, Flagged or Cleared; currency is derived lazily from versions
- New APIs for policies, policy evaluations, policies to evaluate, posted evaluations and an approval with policy override
- API entities renamed from policy flags to policy evaluations, and flaggedAt is renamed to evaluatedAt
- Approval checks policy currency when Evaluate Policies is enabled; posting copies only current evaluations to the posted table
- Breaking: existing extensions can stop compiling or working.
AL objects touched
- Page 6909 “Exp. Report Line Particip. API”, ExpenseAgent: modified
- Page 6915 “Exp. Report Line Per Diem API”, ExpenseAgent: modified
- Page 7104 “Expense Policies API”, ExpenseAgent: added
- Page 7126 “Expense Policy Evaluations API”, ExpenseAgent: added
- Page 6905 “Expense Report Line Item API”, ExpenseAgent: modified
- Page 6929 “Expense Report Lines API”, ExpenseAgent: modified
- Page 6928 “Expense Reports API”, ExpenseAgent: modified
- Page 7108 “Exp. Policies To Eval API”, ExpenseAgent: added
- Codeunit 7107 “Exp. Policies To Eval Builder”, ExpenseAgent: added
- Table 7106 “Exp. Policy To Eval Buffer”, ExpenseAgent: added
- Page 6913 “Posted Exp. Report Lines API”, ExpenseAgent: modified
- Page 7105 “Posted Policy Evaluations API”, ExpenseAgent: added
- Codeunit 6901 “Expense Report Approval Mgmt”, ExpenseAgent: modified
- Codeunit 6906 “Expense Capabilities Provider”, ExpenseAgent: modified
- Enum 6984 “Expense Capability”, ExpenseAgent: modified
- Enum 6989 “Expense Policy Status”, ExpenseAgent: added
- Enum 6990 “Expense Policy Subject”, ExpenseAgent: added
- Page 7125 “Expense Policy Evaluation Card”, ExpenseAgent: added
- Page 7124 “Expense Policy Evaluations”, ExpenseAgent: added
- Page 7109 “Posted Exp. Policy Evaluations”, ExpenseAgent: added
- Page 7106 “Posted Policy Evaluation Card”, ExpenseAgent: added
- Table 7096 “Expense Policy Evaluation”, ExpenseAgent: added
- Table 7105 “Posted Exp. Policy Evaluation”, ExpenseAgent: added
- Codeunit 6987 “Expense Report-Post”, ExpenseAgent: modified
- Codeunit 6984 “Release Exp. Report Document”, ExpenseAgent: modified
- Page 6999 “Expense Report SubPage”, ExpenseAgent: modified
- Page 6993 “Posted Expense Report SubP.”, ExpenseAgent: modified
- Table 6906 “Expense Report Header”, ExpenseAgent: modified
- Table 6907 “Expense Report Line”, ExpenseAgent: modified
- Table 6911 “Expense Report Line Item”, ExpenseAgent: modified
- Table 6908 “Expense Report Line Particip.”, ExpenseAgent: modified
- Table 6909 “Expense Report Line Per Diem”, ExpenseAgent: modified
- Table 6916 “Posted Expense Report Line”, ExpenseAgent: modified
- Page 6945 “Expense Category Card”, ExpenseAgent: modified
- Page 7127 “Expense Policies”, ExpenseAgent: added
- Table 7092 “Expense Policy”, ExpenseAgent: added
- Permission set 6953 “Expense Agent - Data”, ExpenseAgent: modified
- Permission set 6952 “Expense Agent - Objects”, ExpenseAgent: modified
- Permission set 6904 “Expense Management - Objects”, ExpenseAgent: modified
- Permission set 6905 “Expense Mgmt. Admin”, ExpenseAgent: modified
- Permission set 6906 “Expense Mgmt. Edit”, ExpenseAgent: modified
- Permission set 6907 “Expense Mgmt. Read”, ExpenseAgent: modified
- Codeunit 6950 “Expense Agent Privacy Subs.”, ExpenseAgent: modified
- Page 6996 “Expense Agent Setup”, ExpenseAgent: modified
- Page 6991 “Expense Agent Setup Wizard”, ExpenseAgent: modified
- Table 6930 “Expense Agent Setup”, ExpenseAgent: modified
Context
- Work items: AB#626515
- Labels: AL: Apps (W1), Team: Integrations
- Systems: development
- From the description: “Expense Agent needs a backend contract for AI-assisted policy evaluation that records both compliant and non-compliant results.”
Source: metadata of a merged pull request in microsoft/BCApps (bcapps): title, labels, changed paths and counts, with a summary in our words. No source text and no description beyond one short quote (D10, D61).