News for hackers. Stuff that matters.
Re:Copilot broke audit logs, but Microsoft won't tell customers by krisoft on Wednesday August 20, 2025 @04:38AM (#44959948)
> This means Vector databases, Search Indexes or fancy "AI Search Databases" would be required on a per user basis or track the access rights along with the content, which is infeasible and does not scale.

I don't understand why you think tracking user access rights would be infeasible and would not scale. There is a query. You search for matching documents in your vector database / index. Once you have found the potentially relevant list of documents you check which ones can the current user access. You only pass the ones over to the LLM which the user can see.

This is very similar to how banks provide phone based services. The operator on the other side of the line can only see your account details once you have authenticated yourself. They can't accidentally tell you someone else's account balance, because they themselves don't have access to it unless they typed in all the information you provide them to authenticate yourself. You can't trick the operator to provide you with someone else's account balance because they can't see the account balance of anyone without authenticating first.

Re:Copilot broke audit logs, but Microsoft won't tell customers by doomslice on Wednesday August 20, 2025 @07:37AM (#44960911)
Let's say you have 100000 documents in your index that match your query but only 10 of them the user has access to:

A basic implementation will return the top, let's say 1000, documents and then do the more expensive access check on each of them. Most of the time, you've now eliminated all of your search results.

Your search must be access aware to do a reasonable job of pre-filtering the content to documents the user has access to, at which point you then can apply post-filtering with the "100% sure" access check.

Re:Copilot broke audit logs, but Microsoft won't tell customers by DannyBee on Wednesday August 20, 2025 @08:03AM (#44961084)
Yes. But this is still an incredibly well known and solved problem. As an example - google's internal structured search engines did this decades ago at scale.
Re:Copilot broke audit logs, but Microsoft won't tell customers by Isn0gud on Wednesday August 20, 2025 @08:32AM (#44961325)
Which solutions are you referring to? With access that is highly diverse and changing, this is still an unsolved problem to my knowledge.
Re:Copilot broke audit logs, but Microsoft won't tell customers by jsnell on Wednesday August 20, 2025 @08:58AM (#44961532)
Probably Google Zanzibar (and the various non-Google systems that were created as a result of the paper describing Zanzibar).
Re:Copilot broke audit logs, but Microsoft won't tell customers by thunky on Wednesday August 20, 2025 @07:59AM (#44961051)
> Let's say you have 100000 documents in your index that match your query

If the docs were indexed by groups/roles and you had some form of RBAC then this wouldn't happen.

Re:Copilot broke audit logs, but Microsoft won't tell customers by beaviskhan on Wednesday August 20, 2025 @08:25AM (#44961264)
If you take this approach, you have to reindex when groups/roles changes - not always a feasible choice
Re:Copilot broke audit logs, but Microsoft won't tell customers by thunky on Wednesday August 20, 2025 @08:41AM (#44961390)
You only have to update the metadata, not do a full reindex.
Re:Copilot broke audit logs, but Microsoft won't tell customers by scott_w on Wednesday August 20, 2025 @08:51AM (#44961480)
You'd have to reindex the metadata (roles access), which may be substantial if you have a complex enough schema with enough users/roles.
Re:Copilot broke audit logs, but Microsoft won't tell customers by thunky on Wednesday August 20, 2025 @10:05AM (#44962102)
> You'd have to reindex the metadata (roles access), which may be substantial if you have a complex enough schema with enough users/roles.

Right, but this compare this to the original proposal:

> A basic implementation will return the top, let's say 1000, documents and then do the more expensive access check on each of them

Using an index is much better than that.

And it should be possible to update the index without a substantial cost, since most of the 100000 documents likely aren't changing their role access very often. You only have to reindex a document's metadata when that changes.

This is also far less costly than updating the actual content index (the vector embeddings) when the document content changes, which you have to do regardless of your permissions model.

Re:Copilot broke audit logs, but Microsoft won't tell customers by hannasanarion on Thursday August 21, 2025 @02:11AM (#44969565)
I don't understand how "using an index" is a solution to this problem. If you're doing search, then you already have an index.

If you use your index to get search results, then you will have a mix of roles that you then have to filter.

If you want to filter first, then you need to make a whole new search index from scratch with the documents that came out of the filter.

You can't use the same indexing information from the full corpus to search a subset, your classical search will have undefined IDF terms and your vector search will find empty clusters.

If you want quality search results and a filter, you have to commit to reindexing your data live at query time after the filter step and before the search step.

I don't think Elastic supports this (last time I used it it was being managed in a bizarre way, so I may be wrong). Azure AI Search does this by default. I don't know about others.

Re:Copilot broke audit logs, but Microsoft won't tell customers by thunky on Thursday August 21, 2025 @07:31AM (#44971457)
> I don't understand how "using an index" is a solution to this problem. If you're doing search, then you already have an index

It's a separate index.

You store document access rules in the metadata. These metadata fields can be indexed and then use as a pre-filter before the vector search.

> I don't think Elastic supports this

https://www.elastic.co/docs/solutions/search/vector/knn#knn-...

Re:Copilot broke audit logs, but Microsoft won't tell customers by smarx007 on Wednesday August 20, 2025 @08:31AM (#44961313)
Apache Accumulo solved the access-aware querying a while ago.
Re:Copilot broke audit logs, but Microsoft won't tell customers by perlgeek on Wednesday August 20, 2025 @10:17AM (#44962203)
"Fun" Fact: ServiceNow simply passes this problem on to its users.

I've seen a list of what was supposed to be 20 items of something, it only showed 2, plus a comment "18 results were omitted to insufficient permissions".

(Servicenow has at least three different ways to do permissions, I don't know if this applies to all of them).

Re:Copilot broke audit logs, but Microsoft won't tell customers by plaguuuuuu on Wednesday August 20, 2025 @12:12PM (#44963218)
I'm not sure if enumerating the hidden results are a great idea :0
Re:Copilot broke audit logs, but Microsoft won't tell customers by perlgeek on Wednesday August 20, 2025 @12:29PM (#44963390)
At least it's terrible user experience to have to click on the "more" button several times to see the number of items you actually wanted to see.

But yes, one could probably also construct a series of queries that reveal properties of hidden objects.

Re:Copilot broke audit logs, but Microsoft won't tell customers by senko on Wednesday August 20, 2025 @10:35AM (#44962365)
Just use a database that supports both filtering and vector search, such as postgres with pgvector (or any other, I think all are adding vector search nowadays).
Re:Copilot broke audit logs, but Microsoft won't tell customers by pierrebrunelle on Wednesday August 20, 2025 @11:01AM (#44962575)
Agree...as simple as:

@pxt.query def search_documents(query_text: str, user_id: str): sim = chunks.text.similarity(query_text) return ( chunks.where( (chunks.user_id == user_id) # Metadata filtering & (sim > 0.5) # Filter by similarity threshold & (pxt_str.len(chunks.text) > 30) # Additional filter/transformation ) .order_by(sim, asc=False) .select( chunks.text, source_doc=chunks.document, # Ref to the original document sim=sim, title=chunks.title, heading=chunks.heading, page_number=chunks.page ) .limit(20) )

For instance in https://github.com/pixeltable/pixeltable

Re:Copilot broke audit logs, but Microsoft won't tell customers by seanw265 on Wednesday August 20, 2025 @11:17AM (#44962719)
If you can move your access check to the DB layer, you skip a lot of this trouble.

Index your ACLs, index your users, index your docs. Your database can handle it.

Re:Copilot broke audit logs, but Microsoft won't tell customers by hannasanarion on Thursday August 21, 2025 @01:59AM (#44969502)
The thing about a user needing access to only 10 documents is that creating a new index from scratch on those ten documents takes basically zero time.

Vector Databases intended for this purpose filter this way by default for exactly this reason. It doesn't matter how many documents are in the master index, it could be 100000 or 100000000,doesn't matter. Once you filter down to the 10 that your user is allowed to see, it takes the same tenth of a second or whatever to whip up a new bespoke index just for them for this query.

Pre-search filtering is only a problem when your filter captures a large portion of the original corpus, which is rare. How often are you querying "all documents that Joe Schmoe isn't allowed to view"?

Re:Copilot broke audit logs, but Microsoft won't tell customers by lukan on Wednesday August 20, 2025 @06:10AM (#44960492)
Thank you for context, I wondered the same.

But I guess they want something like training the chatbot as a LLM once with all the confidential data - and then indeed you could never separate it again.

Re:Copilot broke audit logs, but Microsoft won't tell customers by chaosite on Wednesday August 20, 2025 @05:01AM (#44960071)
> You search for matching documents in your vector database / index. Once you have found the potentially relevant list of documents you check which ones can the current user access. You only pass the ones over to the LLM which the user can see.

Sometimes the potentially relevant list of documents itself is a leak all by itself.

Re:Copilot broke audit logs, but Microsoft won't tell customers by redwood on Wednesday August 20, 2025 @05:43AM (#44960322)
But you process that list in a trusted audited app tier not in the client environment
Re:Copilot broke audit logs, but Microsoft won't tell customers by lixtra on Wednesday August 20, 2025 @06:14AM (#44960512)
A naive approach could still leak information through side channels. E.g. if you search regularly for foobar, the answer might suddenly get slower if foobar appears more in the document base.

Depending on the context it could be relevant.

Re:Copilot broke audit logs, but Microsoft won't tell customers by shawnz on Wednesday August 20, 2025 @10:14AM (#44962170)
That's nothing specific to LLM-enhanced search features though, right? Any search feature will have that side channel risk
Re:Copilot broke audit logs, but Microsoft won't tell customers by hannasanarion on Thursday August 21, 2025 @02:13AM (#44969580)
But we're talking about access control, so in this case "filtering for foobar" means "filtering for stuff I'm allowed to see", and the whole point is that you can never turn that filter off to get a point of comparison.

If Joe's search is faster than Sally's because Sally has higher permissions, that's hardly a revelation.

Re:Copilot broke audit logs, but Microsoft won't tell customers by scott_w on Wednesday August 20, 2025 @08:50AM (#44961472)
> I don't understand why you think tracking user access rights would be infeasible and would not scale.

Allow me to try to inject my understanding of how these agents work vs regular applications.

A regular SaaS will have an API endpoint that has permissions attached. Before the endpoint processes anything, the user making the request has their permissions checked against the endpoint itself. Once this request succeeds, anything that endpoint collects is considered "ok" ship to the user.

AI Agents, instead, directly access the database, completely bypassing this layer. That means you need to embed the access permissions into the individual rows, rather than at the URL/API layer. It's much more complex as a result.

For your bank analogy: they actually work in a similar way to how I described above. A temporary access is granted to the resources but, once it's granted, any data included in those screens is assumed to be ok. They won't see something like a blank box somewhere because there's info they're not supposed to see.

DISCLAIMER: I'm making an assumption on how these AI Agents work, I could be wrong.

Re:Copilot broke audit logs, but Microsoft won't tell customers by krisoft on Wednesday August 20, 2025 @11:17AM (#44962720)
> AI Agents, instead, directly access the database, completely bypassing this layer.

If so, then as the wise man says: "well, there‘s your problem!"

I don't doubt there are implementations like that out there, but we should not judge the potential of a technology by the mistakes of the most boneheaded implementation.

Doing the same in the bank analogy would be like giving root SQL access to the phone operators and then asking them pretty please to be careful with it.

Re:Copilot broke audit logs, but Microsoft won't tell customers by scott_w on Wednesday August 20, 2025 @01:17PM (#44963875)
> If so, then as the wise man says: "well, there‘s your problem!"

Of course, I wouldn't defend this! To be clear, it's not possible to know how every AI Agent works, I just go off what I've seen when a company promises to unlock analytics insights on your data: usually by plugging directly into the Prod DB and having your data analysts complain whenever the engineers change the schema.

> we should not judge the potential of a technology by the mistakes of the most boneheaded implementation.

I agree.

Re:Copilot broke audit logs, but Microsoft won't tell customers by hannasanarion on Thursday August 21, 2025 @02:17AM (#44969607)
Having the agent plugged into the DB doesn't mean the agent can see everything in the DB. If that plug includes an automatic "where current user has access" filter, then the agent can't know anything the user can't know.

That's what the bank agent analogy was meant to tell you. The agent has a direct line to the prod DB through their computer terminal, but every session they open is automatically constrained to the account details if the person on the phone right now and nobody else.

Re:Copilot broke audit logs, but Microsoft won't tell customers by scott_w on Thursday August 21, 2025 @03:58AM (#44970279)
> Having the agent plugged into the DB doesn't mean the agent can see everything in the DB. If that plug includes an automatic "where current user has access" filter, then the agent can't know anything the user can't know.

It depends on how it's plugged-in. If you just hand it a connection and query access then what exactly stops it? In a lot of SaaS systems, there's only the "application" user, which is restricted via queries within the API.

You can create a user in the DB per user of your application but this isn't free. Now you have the operational problem of managing your permissions, not via application logic, but subject to the rules and restrictions of your DBMS.

You can also create your own API layer on top, however this also comes with constraints of your API and adding protections on your query language.

None of this is impossible but, given what I've seen happen in the data analytics space, I can tell you that I know which option business leaders opt for.

Re:Copilot broke audit logs, but Microsoft won't tell customers by GloriousMEEPT on Wednesday August 20, 2025 @09:04AM (#44961580)
The solution to this problem is to develop your agents to use delegation and exchange tokens for access to other services using an on-behalf-of flow. Agents are never operating under their own identity, but as the user.
Re:Copilot broke audit logs, but Microsoft won't tell customers by pc86 on Wednesday August 20, 2025 @09:07AM (#44961603)
> I'm making an assumption on how these AI Agents work, I could be wrong.

I don't understand the desire - borderline need - of folks on HN to just make stuff up. That is likely why you're being downvoted. I know we all love to do stuff "frOM fIRsT PRiNcIPlEs" around here but "let me just imagine how I think AI agents work then pass that off as truth" is taking it a bit far IMO.

This is the human equivalent of an AI hallucination. You are just making stuff up, passing it off as truth ("injecting your understanding"), then adding a one-line throwaway "this might be completely wrong lol" at the end.

Re:Copilot broke audit logs, but Microsoft won't tell customers by krapp on Wednesday August 20, 2025 @09:28AM (#44961772)
>I don't understand the desire - borderline need - of folks on HN to just make stuff up.

Hacker News is addictive. This forum is designed to reward engagement with imaginary internet points and that operant conditioning works just as well here as everywhere else.

Re:Copilot broke audit logs, but Microsoft won't tell customers by tough on Wednesday August 20, 2025 @12:00PM (#44963126)
karma please go up
Re:Copilot broke audit logs, but Microsoft won't tell customers by scott_w on Wednesday August 20, 2025 @09:11AM (#44961640)
And yet if we didn't do this, HN would be almost completely silent because 99% of commenters have a clue what they're talking about most of the time and nobody would ever have a chance to learn.
Re:Copilot broke audit logs, but Microsoft won't tell customers by mh- on Wednesday August 20, 2025 @10:26AM (#44962295)
I don't know how to say this less flippantly, and I honestly tried: you could have simply posted a comment phrased as a question, and 20 people would have jumped in to answer.

(To your point, >15 of them would have had different answers and the majority would have been materially wrong, but still.)

Re:Copilot broke audit logs, but Microsoft won't tell customers by scott_w on Wednesday August 20, 2025 @10:59AM (#44962566)
So let me be more direct. The part I'm not confident I'm correct in is this:

> AI Agents, instead, directly access the database

However, I don't think I'd be too far off the mark given many systems work like this (analytics tools typically hook into your DB, to the chagrin of many an SRE/DevOps) and it's usually marketed as the easy solution. Also, I've since read a few comments and it appears I'm pretty fucking close: the agents here read a search index, so pretty tightly hooked into a DB system.

Everything else, I know I'm right (I've built plenty of systems like this), and someone was making a point that permissions access does scale. I pointed out that it appears to scale because of the way they're designed.

I'd say most of my comment is substantively correct, with a disclaimer on an (important) point, where I'd be happy to be corrected.

Re:Copilot broke audit logs, but Microsoft won't tell customers by Karrot_Kream on Thursday August 21, 2025 @04:28PM (#44977659)
The correct way to setup an analytics tool is to point it to an analytics db that is a replica of your main DB. It's a pretty common part of an HA setup to replicate your primary to an actual hot read replica and a cold analytics store. This way the analytics tool queries your analytics store and doesn't put load on your hot primary or hot read replica.

> I'd say most of my comment is substantively correct, with a disclaimer on an (important) point, where I'd be happy to be corrected.

I read this and feel that you still want imaginary internet points for something that is, at best, directionally correct. To me it seems your desire for internet points urged you to post a statement and not a question. I imagine most of HN is just statements that are overconfident bluster by only directionally correct statements which create the cacophony of this site.

Re:Copilot broke audit logs, but Microsoft won't tell customers by scott_w on Friday August 22, 2025 @01:30AM (#44981290)
> The correct way to setup an analytics tool is to point it to an analytics db that is a replica of your main DB. It's a pretty common part of an HA setup to replicate your primary to an actual hot read replica and a cold analytics store. This way the analytics tool queries your analytics store and doesn't put load on your hot primary or hot read replica.

That doesn’t solve the problem of changing schemas causing issues for your data team at all. Something I see regularly. If you setup an AI Agent the same way you still give it full access, so you still haven’t fixed the problem at hand.

> I read this and feel that you still want imaginary internet points for something that is, at best, directionally correct.

And you’ve yet to substantiate your objection to what I posited (alongside everyone else), so instead you continue to talk about something unrelated in the hope of… what, exactly?

Re:Copilot broke audit logs, but Microsoft won't tell customers by planb on Wednesday August 20, 2025 @04:31PM (#44966103)
I’ll answer to this as a placeholder for all the „just do xyz“ replies:

Searching the whole index and then filtering is possible, but infeasible for large indexes where a specific user only has access to a few docs. And for diverse data sources (as we want to access), this would be really slow, many systems would need to be checked.

So, access rights should be part of the index. In that case, we are just storing a copy of the access rights, so this is prone to races. Besides that, we have multiple systems with different authorization systems, groups, roles, whatever. To homogenize this, we would need to store the info down to each individual user. Besides this, not all systems even support asking which users have access to resource Y, they only allow to ask „has X access to Y“.