I think it's pretty obvious that Leia's rebel sympathies were no secret to the likes of Vader and Tarkin.
Note that in 'Siege of Lothal' Minister Tua mentions that there are several known rebels who are left alone because they have powerful friends in the senate. Bail and by extension Leia are probably among them. Mon Mothma too I'd imagine. Based on that and the dialogue in ANH, the Empire seems to know they're involved but don't have enough solid proof to try them for treason without significant backlash.
Remember that in this time (and right up until ANH) the senate was still a relevant and powerful body that the Emperor needed to manage all the thousands of planetary bureaucracies. It wasn't until the Death Star went fully online that Palpatine did away with them (probably including a "night of the long knives" type situation that sent the likes of Mon Mothma fleeing underground) on the theory that it would allow them to enforce martial law across the galaxy.
It's actually interesting to think that this act may have been what ultimately doomed the Empire. With the senate gone and the Death Star destroyed, they'd have to depend on that Imperial star fleet to keep order *and* chase down the rebels, probably all the while being harassed by guerilla actions. Endor was probably as much of a last stand for the Empire as it was for the Alliance.
Anyway, for the record, here's the ANH opening crawl in full: -
It is a period of civil war.
Rebel spaceships, striking
from a hidden base, have won
their first victory against
the evil Galactic Empire.
During the battle, rebel
spies managed to steal secret
plans to the Empire's
ultimate weapon, the DEATH
STAR, an armored space
station with enough power to
destroy an entire planet.
Pursued by the Empire's
sinister agents, Princess
Leia races home aboard her
starship, custodian of the
stolen plans that can save
her people and restore
freedom to the galaxy....
You can split hairs of you choose to do so, but the intended implication is clearly in that this battle was the Alliance's first (successful) head-on fight with the Empire. Presumably hitting an Imperial facility (maybe even the not-yet-online Death Star itself) where the plans were stored. Based on the text, the point was to create enough of a distraction to allow embedded agents to get to data and transmit it to Leia's ship.
Indeed, I have the shooting script in-front of me and there's an extra line of dialogue that implies that Leia's ship was in the system during the battle.
ANH script said:
LEIA
Lord Vader, I should have known.
Only you could be so bold. The
Imperial Senate will not sit for
this, when they hear you've attacked
a diplomatic...
VADER
Don't play games with me, Your
Highness. You weren't on any mercy
mission this time. You passed directly
through a restricted system. Several
transmissions were beamed to this
ship by Rebel spies. I want to know
what happened to the plans they sent
you.
LEIA
I don't know what you're talking
about. I'm a member of the Imperial
Senate on a diplomatic mission to
Alderaan...
VADER
You're a part of the Rebel Alliance...
and a traitor. Take her away!
If that system was where the Death Star was being built, then it was probably Geonosis (according to Lucas IIRC), which actually makes a lot of sense if their next stop was Tatooine, given that AotC established they were relatively close by.
Ironic that the last time a Skywalker and a Naberrie were both in that system it started a war, and there they are again.
