Suggestions in the comments are correct.
The device in question is side booster separation sensor. It can be described as mechanical plunger switch which is installed in the center of the side booster upper ball joint.
The pin (which happenned to be deformed and was declared as the primary reason of the sequence of events that led to the failure of Soyuz-FG launch vehicle during MS-10 mission) is marked 9 in the sketch below (it is installed in the axial direction, not to be confused with two cylindrical parts protruding from the ball joint in radial direction, see close-up photo below).
As the side booster separates from the central core, the ball (11) would slide out of the housing (7), then the pin would retract from the ball under the spring force (8) and trigger an electric contact switch* (10) which serves as an input signal for the following phase of the side booster separation process.
The sources I found don't explicitly say whether the switch opens or closes electrical circuit, they just mention that an electrical type of signal is being triggered
All the pictures and majority of technical information are borrowed from this excellent writeup (in Russian) covering in great detail the side boosters (nicknamed "carrots") attachment and separation processes for R-7 derived family of launch vehicles.
Below (translated from Russian) is the sequence from this source (in Russian) of the side booster separation process, amended by technical details from the article mentioned above.
After the side boosters finished their job, i.e. when the launch vehicle reaches a certain speed (for MS-10 it was around 118 seconds into the flight):
- Engines of the side boosters are throttled down [typically to 75-85%]. After a time the vernier thrusters of the side boosters are shut down. [Central booster continues operating under full thrust]
- The ties between side boosters and the central booster at the bottom are torn [blown up using pyro-charge], and ...
Because the side boosters main engine thrust vector (red line on the right) is offset (rotated 3.5°) compared to the side booster axis (red line on the left), the moment (torque) is created around the ball joint on the top so the side boosters are being pivoted around the ball joints, which effectively makes
... the tail of the side boosters move to the side [i.e. in radial direction, away from the central booster, marked a) on the picture below]
- The side boosters main engines are shut down.
As the central booster keeps going on the full thrust, it effectively pulls the central part upwards relative to the side boosters which are now decelerating due to the drag.
The side boosters move "backwards" [relative to the central booster] and the ball joints [being part of the side boosters] are detaching from their housings [being part of the central booster].
The side boosters detachment is sensed by mechanical plunger switch [one per each booster]
As described at the start of the answer, when the ball moves out of the housing, the rod retracts under the spring load and triggers an electrical switch.
the signal from the switch serves as an input for [opening] the oxidizer tank vent valve.
When the detachment sensor contact is triggered, pyrocharge blows the lock on the vent valve, and the valve is opened by pressure of the oxidizer tank pressurization gas.
The oxidizer tank pressurization gas then flows through the cold gas thruster located at the top of the side booster (location of the thruster is marked by the red arrow on the right in the following picture)
- By [the means of] thrusting the gas [at the top of the booster, in direction towards the central booster], the top part of the side booster is torquing [away from the central core ( b) and c) on the picture above)].
- Separation is further aided by venting the fuel tank pressurization gas propulsively in the same manner as the oxidizer tank pressurization gas in the step 6 above.
So the above sequence should result in what's shown in this animated gif:
In case of the MS-10 flight, the bent pin (the figure of 6°45' was reported) in one of the side boosters (during step 5 of this sequence) got stuck in its bore and failed to retract, so the contact wasn't triggered, hence the command to open oxidiser tank vent valve never happened and the top part of the side booster instead of torquing away from the central booster kept going down, performed collision with the central booster and damaged it:
According to Sergei Krikalyov of Roscosmos, the primary cause of the failure was a collision that occurred during the separation of the carrier rocket's first and second stages. "A deviation from the standard trajectory occurred and apparently the lower part of the second stage disintegrated" he said.