Authorization

Meta-Tool Convergence for Enterprise APIs and a Chained LLM Call Defense Line

1890 words · ~9 min read
0 views

This is a channel design note, scoped to the segment where a server-side enterprise system opens business capabilities to a large language model: how tools are organized, how calls are authorized, and how responses leave the channel. Prompt strategy on the model side and human confirmation in the orchestration layer are out of scope. Component names and step numbers correspond to a working implementation; organization, customer, and deployment details are omitted.

The Read Gate of Multi-Tenant Isolation: Persistence Lifecycle Callbacks and Aspect Ordering

1602 words · ~8 min read
0 views

This is an isolation-mechanism note, scoped to ORM-based multi-tenant systems with shared schemas and shared applications. Component names and step numbers correspond to a working implementation; organization, customer, and deployment details are omitted. The subject is framework-level mechanism, not conventions such as “remember to add the tenant condition in business code.”

The conclusion first: multi-tenant isolation that relies solely on ORM query filters is incomplete, and the gap is not in how queries are written — it is the primary-key load path that never passes through the filter. The repair is not another business-layer condition but a read gate pushed down into persistence lifecycle callbacks: every entity row entering the persistence context has its tenant ownership checked once at @PostLoad, and a mismatch terminates the load. Three judgments up front: 1) if filter activation matches annotations or class names, renames and package moves silently disable isolation, so drift must be eliminated mechanically; 2) wrong aspect ordering disables the whole mechanism — filter activation requires an active transaction and persistence context; 3) the write side must trust only server-side tenant context, never a caller-supplied tenant identifier.