trustmodel 3.3.2__tar.gz → 3.4.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. {trustmodel-3.3.2 → trustmodel-3.4.1}/PKG-INFO +1 -1
  2. {trustmodel-3.3.2 → trustmodel-3.4.1}/pyproject.toml +1 -1
  3. {trustmodel-3.3.2 → trustmodel-3.4.1}/src/trustmodel/endpoints/agentcert.py +26 -3
  4. {trustmodel-3.3.2 → trustmodel-3.4.1}/src/trustmodel/endpoints/guardrails.py +9 -1
  5. {trustmodel-3.3.2 → trustmodel-3.4.1}/.gitignore +0 -0
  6. {trustmodel-3.3.2 → trustmodel-3.4.1}/LICENSE +0 -0
  7. {trustmodel-3.3.2 → trustmodel-3.4.1}/README.md +0 -0
  8. {trustmodel-3.3.2 → trustmodel-3.4.1}/src/trustmodel/__init__.py +0 -0
  9. {trustmodel-3.3.2 → trustmodel-3.4.1}/src/trustmodel/cli.py +0 -0
  10. {trustmodel-3.3.2 → trustmodel-3.4.1}/src/trustmodel/client.py +0 -0
  11. {trustmodel-3.3.2 → trustmodel-3.4.1}/src/trustmodel/compat.py +0 -0
  12. {trustmodel-3.3.2 → trustmodel-3.4.1}/src/trustmodel/endpoints/__init__.py +0 -0
  13. {trustmodel-3.3.2 → trustmodel-3.4.1}/src/trustmodel/endpoints/_runtime_transport.py +0 -0
  14. {trustmodel-3.3.2 → trustmodel-3.4.1}/src/trustmodel/endpoints/agentic.py +0 -0
  15. {trustmodel-3.3.2 → trustmodel-3.4.1}/src/trustmodel/endpoints/batch_jobs.py +0 -0
  16. {trustmodel-3.3.2 → trustmodel-3.4.1}/src/trustmodel/endpoints/config.py +0 -0
  17. {trustmodel-3.3.2 → trustmodel-3.4.1}/src/trustmodel/endpoints/credits.py +0 -0
  18. {trustmodel-3.3.2 → trustmodel-3.4.1}/src/trustmodel/endpoints/evaluations.py +0 -0
  19. {trustmodel-3.3.2 → trustmodel-3.4.1}/src/trustmodel/endpoints/frameworks.py +0 -0
  20. {trustmodel-3.3.2 → trustmodel-3.4.1}/src/trustmodel/endpoints/galileo.py +0 -0
  21. {trustmodel-3.3.2 → trustmodel-3.4.1}/src/trustmodel/endpoints/mcp_scanner.py +0 -0
  22. {trustmodel-3.3.2 → trustmodel-3.4.1}/src/trustmodel/endpoints/models.py +0 -0
  23. {trustmodel-3.3.2 → trustmodel-3.4.1}/src/trustmodel/exceptions.py +0 -0
  24. {trustmodel-3.3.2 → trustmodel-3.4.1}/src/trustmodel/models/__init__.py +0 -0
  25. {trustmodel-3.3.2 → trustmodel-3.4.1}/src/trustmodel/models/agentcert.py +0 -0
  26. {trustmodel-3.3.2 → trustmodel-3.4.1}/src/trustmodel/models/agentic.py +0 -0
  27. {trustmodel-3.3.2 → trustmodel-3.4.1}/src/trustmodel/models/batch_job.py +0 -0
  28. {trustmodel-3.3.2 → trustmodel-3.4.1}/src/trustmodel/models/credits.py +0 -0
  29. {trustmodel-3.3.2 → trustmodel-3.4.1}/src/trustmodel/models/evaluation.py +0 -0
  30. {trustmodel-3.3.2 → trustmodel-3.4.1}/src/trustmodel/models/frameworks.py +0 -0
  31. {trustmodel-3.3.2 → trustmodel-3.4.1}/src/trustmodel/models/galileo.py +0 -0
  32. {trustmodel-3.3.2 → trustmodel-3.4.1}/src/trustmodel/models/guardrails.py +0 -0
  33. {trustmodel-3.3.2 → trustmodel-3.4.1}/src/trustmodel/models/mcp_scanner.py +0 -0
  34. {trustmodel-3.3.2 → trustmodel-3.4.1}/src/trustmodel/models/models.py +0 -0
  35. {trustmodel-3.3.2 → trustmodel-3.4.1}/src/trustmodel/models/oauth.py +0 -0
  36. {trustmodel-3.3.2 → trustmodel-3.4.1}/src/trustmodel/oauth/__init__.py +0 -0
  37. {trustmodel-3.3.2 → trustmodel-3.4.1}/src/trustmodel/oauth/auth.py +0 -0
  38. {trustmodel-3.3.2 → trustmodel-3.4.1}/src/trustmodel/oauth/scopes.py +0 -0
  39. {trustmodel-3.3.2 → trustmodel-3.4.1}/src/trustmodel/telemetry/__init__.py +0 -0
  40. {trustmodel-3.3.2 → trustmodel-3.4.1}/src/trustmodel/telemetry/_constants.py +0 -0
  41. {trustmodel-3.3.2 → trustmodel-3.4.1}/src/trustmodel/telemetry/_instrumentors.py +0 -0
  42. {trustmodel-3.3.2 → trustmodel-3.4.1}/src/trustmodel/telemetry/auto_init.py +0 -0
  43. {trustmodel-3.3.2 → trustmodel-3.4.1}/src/trustmodel/utils/__init__.py +0 -0
  44. {trustmodel-3.3.2 → trustmodel-3.4.1}/src/trustmodel/utils/validation.py +0 -0
  45. {trustmodel-3.3.2 → trustmodel-3.4.1}/src/trustmodel/utils/version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: trustmodel
3
- Version: 3.3.2
3
+ Version: 3.4.1
4
4
  Summary: Official Python SDK for TrustModel AI evaluation platform
5
5
  Project-URL: Homepage, https://trustmodel.ai
6
6
  Author-email: TrustModel <info@predixtions.com>
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "trustmodel"
7
- version = "3.3.2"
7
+ version = "3.4.1"
8
8
  authors = [
9
9
  {name = "TrustModel", email = "info@predixtions.com"},
10
10
  ]
@@ -102,6 +102,7 @@ class AgentCertEndpoint:
102
102
  subject_agent_id: Optional[str] = None,
103
103
  auditor_slug: Optional[str] = None,
104
104
  validity_days: Optional[int] = None,
105
+ validation_level: Optional[str] = None,
105
106
  ) -> AgentCertificate:
106
107
  """Mint a new AgentCert from a completed evaluation run.
107
108
 
@@ -114,13 +115,24 @@ class AgentCertEndpoint:
114
115
  RAG corpus runs are rejected with a stable 400 error code so callers
115
116
  can route the user back to picking a compatible run.
116
117
 
118
+ **Validation tiers (TRUS-1673):** ``validation_level="DV"`` (default,
119
+ free) or ``"OV"`` (paid — requires the org to have OV entitlement in
120
+ the Marketplace plan AND the ``ans_name`` to be organization-validated
121
+ (``assurance_tier=OV``) in the ANS registry). Callers who omit the
122
+ kwarg get DV — byte-identical to pre-1673 behaviour. OV rejection
123
+ surfaces as one of three stable error codes that map to typed
124
+ exceptions (see ``Raises``).
125
+
117
126
  Args:
118
127
  ans_name: Agent Naming Service binding (e.g. ``helpbot.cisco.com``).
119
128
  evaluation_run_id: Source eval run id (must belong to the org).
120
129
  subject_agent_id: Optional agent identifier; derived from the eval
121
130
  when omitted.
122
131
  auditor_slug: Optional auditor to link the cert to.
123
- validity_days: Optional cert lifetime (1–825); backend default 90.
132
+ validity_days: Optional cert lifetime (1–825); backend picks a
133
+ per-tier default when omitted (DV=90, OV=365).
134
+ validation_level: Optional cert tier — ``"DV"`` (default) or
135
+ ``"OV"``. Omit for DV. See TRUS-1673.
124
136
 
125
137
  Returns:
126
138
  The minted :class:`AgentCertificate`.
@@ -133,8 +145,14 @@ class AgentCertEndpoint:
133
145
  ``status=completed`` yet. Subclass of :class:`APIError`.
134
146
  EvaluationNotFoundError: run id isn't visible in the caller's
135
147
  org (or doesn't exist). Subclass of :class:`APIError`.
136
- APIError: any other non-2xx (e.g. 400 issuance_failed,
137
- 500 internal_issuance_error, 429).
148
+ APIError: any other non-2xx. TRUS-1673 introduces three new stable
149
+ codes for OV rejection surfaced on ``exc.error_code``:
150
+ ``unentitled_for_ov`` (403 — org's plan doesn't include OV),
151
+ ``validation_required`` (403 — ans_name isn't
152
+ ``assurance_tier=OV``), ``assurance_lookup_failed`` (502 —
153
+ ans-registry unreachable, retriable). Also
154
+ ``cannot_downgrade_active_cert`` (400) when re-minting at DV
155
+ over an existing active OV cert.
138
156
  """
139
157
  if not ans_name:
140
158
  raise ValueError("agentcert.issue(): `ans_name` is required")
@@ -148,6 +166,11 @@ class AgentCertEndpoint:
148
166
  data["auditor_slug"] = auditor_slug
149
167
  if validity_days is not None:
150
168
  data["validity_days"] = validity_days
169
+ # TRUS-1673 — send ``validation_level`` on the wire only when the
170
+ # caller opts in. Omitting matches pre-1673 wire body byte-for-byte,
171
+ # so the BE default (DV) applies and existing callers see no change.
172
+ if validation_level is not None:
173
+ data["validation_level"] = validation_level
151
174
 
152
175
  try:
153
176
  response = self._client.post(_ISSUE_PATH, data=data)
@@ -254,6 +254,7 @@ class GuardrailsEndpoint:
254
254
  subject=subject,
255
255
  subject_attrs=dict(subject_attrs) if subject_attrs else None,
256
256
  agent_id=agent_id,
257
+ policy_name=resolved_policy_name,
257
258
  )
258
259
  raw = edge.post("/v1/decide", body, timeout=_EDGE_TIMEOUT_SECONDS)
259
260
  return _decision_from_edge(raw)
@@ -325,8 +326,15 @@ def _build_edge_body(
325
326
  subject: Optional[str],
326
327
  subject_attrs: Optional[Dict[str, Any]],
327
328
  agent_id: Optional[str],
329
+ policy_name: str,
328
330
  ) -> Dict[str, Any]:
329
- body: Dict[str, Any] = {"tool": tool, "args": args}
331
+ # TRUS-1715 — ``policy_name`` was missing from the Edge body pre-3.4.1.
332
+ # ``decide()`` validated the kwarg at the entry point and then silently
333
+ # discarded the value here, so Edge resolved against its fallback policy
334
+ # (``default``) regardless of what the caller asked for. Aurora carried
335
+ # it correctly on the parallel builder, so cross-transport parity was
336
+ # broken. Reported by Praga @ xspan against SDK 3.3.x.
337
+ body: Dict[str, Any] = {"tool": tool, "args": args, "policy_name": policy_name}
330
338
  if subject is not None:
331
339
  body["subject"] = subject
332
340
  if subject_attrs is not None:
File without changes
File without changes
File without changes