Back to Prompt Library
testing

Structured Evaluation with Testaify

Inspect the original prompt language first, then copy or adapt it once you know how it fits your workflow.

Linked challenge: Global Tax & Legal Compliance Advisor Agent

Format
Code-aware
Lines
23
Sections
6
Linked challenge
Global Tax & Legal Compliance Advisor Agent

Prompt source

Original prompt text with formatting preserved for inspection.

23 lines
6 sections
No variables
1 code block
Design a Testaify test suite for your 'GlobalTaxAdvisor' agent focusing on the 'LegalComplianceQuery' task. Define a few test cases, each with an input query, country, and the expected 'advice', 'is_compliant' status, and list of 'citations'. Describe how Testaify would run these tests and generate reports on the agent's performance, including specific assertion checks for correctness and completeness. Provide a conceptual Python structure for setting up these tests.

```python
# Conceptual Testaify usage (Testaify is an example tool for structured eval)
# from testaify import TestSuite, TestCase, assert_equals, assert_contains

# class GlobalTaxAdvisorTestSuite(TestSuite):
#     def setup(self):
#         self.advisor_agent = initialize_openai_assistant()

#     @TestCase(name="German Corporate Tax Query")
#     def test_german_corporate_tax(self):
#         input_data = {"query": "corporate tax in Germany", "country": "Germany", "context": "small business"}
#         agent_output = self.advisor_agent.run(input_data)
#         assert_equals(agent_output['is_compliant'], True)
#         assert_contains(agent_output['advice'], "15%")
#         assert_contains(agent_output['citations'], "German Corporate Tax Act")

#     @TestCase(name="UK Income Tax Brackets")
#     def test_uk_income_tax(self):
#         input_data = {"query": "income tax brackets UK", "country": "UK", "context": "individual"}
#         agent_output = self.advisor_agent.run(input_data)
#         assert_equals(agent_output['is_compliant'], True)
#         assert_contains(agent_output['advice'], "basic rate")

# if __name__ == '__main__'
#     TestSuite.main(GlobalTaxAdvisorTestSuite)
```

Adaptation plan

Keep the source stable, then change the prompt in a predictable order so the next run is easier to evaluate.

Keep stable

Preserve the rubric, target behavior, and pass-fail criteria as the baseline for evaluation.

Tune next

Adjust fixtures, mocks, and thresholds to the system under test instead of weakening the assertions.

Verify after

Make sure the prompt catches regressions instead of just mirroring the happy-path examples.